| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace RenzoJohnson\Blocks\Settings\Tabs; |
| 6 |
|
| 7 |
use RenzoJohnson\Blocks\Settings\FieldDefinition; |
| 8 |
use RenzoJohnson\Blocks\Settings\FieldType; |
| 9 |
use RenzoJohnson\Blocks\Settings\Requirement; |
| 10 |
use RenzoJohnson\Blocks\Settings\SanitizerType; |
| 11 |
use RenzoJohnson\Blocks\Settings\SectionDefinition; |
| 12 |
use RenzoJohnson\Blocks\Settings\SettingDefinition; |
| 13 |
use RenzoJohnson\Blocks\Settings\TabDefinition; |
| 14 |
use RenzoJohnson\Blocks\Settings\TabProvider; |
| 15 |
|
| 16 |
\defined( 'ABSPATH' ) || exit; |
| 17 |
|
| 18 |
final class ContentTypesTab implements TabProvider { |
| 19 |
|
| 20 |
public function definition(): TabDefinition { |
| 21 |
return new TabDefinition( |
| 22 |
'content-types', |
| 23 |
\__( 'Content Types', 'blocks' ), |
| 24 |
array( |
| 25 |
new SectionDefinition( |
| 26 |
'blocks_content_types_section', |
| 27 |
\__( 'Custom Post Types', 'blocks' ), |
| 28 |
array( |
| 29 |
\__( 'Toggling each content type ON registers the post type, taxonomy (where applicable), and shortcodes; toggling OFF stops registration but does not delete data — the underlying wp_posts rows are preserved.', 'blocks' ), |
| 30 |
), |
| 31 |
array( |
| 32 |
new FieldDefinition( |
| 33 |
'blocks_faq_enabled', |
| 34 |
\__( 'FAQ', 'blocks' ), |
| 35 |
\__( 'Register the FAQ post type and the [blocks-faqs] shortcode.', 'blocks' ), |
| 36 |
FieldType::Checkbox, |
| 37 |
array( |
| 38 |
new SettingDefinition( 'blocks_faq_enabled', 'boolean', false, SanitizerType::Boolean, sensitive: false, exportable: true, public_token: null ), |
| 39 |
), |
| 40 |
array(), |
| 41 |
Requirement::Always, |
| 42 |
), |
| 43 |
new FieldDefinition( |
| 44 |
'blocks_feature_enabled', |
| 45 |
\__( 'Feature', 'blocks' ), |
| 46 |
\__( 'Register the Feature post type, feature_category taxonomy, and [blocks-features] / [blocks-compare] shortcodes.', 'blocks' ), |
| 47 |
FieldType::Checkbox, |
| 48 |
array( |
| 49 |
new SettingDefinition( 'blocks_feature_enabled', 'boolean', false, SanitizerType::Boolean, sensitive: false, exportable: true, public_token: null ), |
| 50 |
), |
| 51 |
array(), |
| 52 |
Requirement::Always, |
| 53 |
), |
| 54 |
new FieldDefinition( |
| 55 |
'blocks_glossary_enabled', |
| 56 |
\__( 'Glossary', 'blocks' ), |
| 57 |
\__( 'Register the Glossary and Glossary Term public post types (creates /glossary/{slug} URLs).', 'blocks' ), |
| 58 |
FieldType::Checkbox, |
| 59 |
array( |
| 60 |
new SettingDefinition( 'blocks_glossary_enabled', 'boolean', false, SanitizerType::Boolean, sensitive: false, exportable: true, public_token: null ), |
| 61 |
), |
| 62 |
array(), |
| 63 |
Requirement::Always, |
| 64 |
), |
| 65 |
new FieldDefinition( |
| 66 |
'blocks_release_enabled', |
| 67 |
\__( 'Release / Changelog', 'blocks' ), |
| 68 |
\__( 'Register the Release post type, structured-fields metabox, changelog_plugin taxonomy, and the [changelog] shortcode.', 'blocks' ), |
| 69 |
FieldType::Checkbox, |
| 70 |
array( |
| 71 |
new SettingDefinition( 'blocks_release_enabled', 'boolean', false, SanitizerType::Boolean, sensitive: false, exportable: true, public_token: null ), |
| 72 |
), |
| 73 |
array(), |
| 74 |
Requirement::Always, |
| 75 |
), |
| 76 |
), |
| 77 |
false, |
| 78 |
), |
| 79 |
), |
| 80 |
Requirement::Always, |
| 81 |
); |
| 82 |
} |
| 83 |
} |
| 84 |
|