<?php
/**
 * CPT Builder - Capabilities tab.
 *
 * @package CptBuilder
 *
 * @var array<string, mixed> $definition
 */

namespace CptBuilder;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
<h2><?php esc_html_e( 'Capabilities', 'wp-powersuite' ); ?></h2>
<p class="description">
	<?php esc_html_e( 'The capability type controls which user permissions guard this post type. Use "post" to reuse standard post permissions, or a custom token (e.g. "book") to build dedicated capabilities such as edit_books.', 'wp-powersuite' ); ?>
</p>

<table class="form-table" role="presentation">
	<tbody>
		<?php
		cptb_arg_text( $definition, 'capability_type', __( 'Capability type (singular)', 'wp-powersuite' ), __( 'Base used to build capabilities. Common values: "post" or "page".', 'wp-powersuite' ), 'post' );
		cptb_arg_text( $definition, 'capability_type_plural', __( 'Capability type (plural)', 'wp-powersuite' ), __( 'Optional plural form for irregular nouns (e.g. singular "box", plural "boxes").', 'wp-powersuite' ), 'posts' );
		cptb_arg_checkbox( $definition, 'map_meta_cap', __( 'Map meta capabilities', 'wp-powersuite' ), __( 'Let WordPress automatically map primitive capabilities (recommended).', 'wp-powersuite' ) );
		?>
	</tbody>
</table>
<p class="description">
	<?php esc_html_e( 'Note: choosing a custom capability type does not grant those capabilities to any role. A roles/capabilities tool or code is required to assign them.', 'wp-powersuite' ); ?>
</p>
