-
Notifications
You must be signed in to change notification settings - Fork 1
Declarations
The array is an associative array with 3 main keys: entity, labels, and settings:
[
'entity' => 'Webaxones\Core\Classification\PostType',
'labels' => [
],
'settings' => [
],
];- The
entitykey defines the entity to create by passing the class name. (Classes are listed in the table below) - The
labelskey passes all of the entity's labels requiring internationalization. - The
settingskey passes all the parameters the entity needs to be processed.
| Entity | Class |
|---|---|
| Custom Post Type | Webaxones\Core\Classification\PostType |
| Custom Taxonomy | Webaxones\Core\Classification\Taxonomy |
| ACF Option Page | Webaxones\Core\Option\AcfOptionsPage |
| Native Option Page | Webaxones\Core\Option\OptionsPage |
| Group of settings | Webaxones\Core\Option\SettingGroup |
| Custom Role | Webaxones\Core\Role\Role |
| Custom Block Category | Webaxones\Core\Editor\Categories\BlockCategory |
| Custom Block Pattern Category | Webaxones\Core\Editor\Categories\BlockPatternCategory |
The labels key contains all the labels of the entity so that they are internationalizable. For the Custom Post Types and Custom Taxonomy entities, the labels have a gender parameter which by default is m (masculine) and allows messages to be personalized.
When an entity contains sub-elements, such as groups of settings, keys located in settings make it possible to make the link with the labels.
The settings part always starts with a slug key which identifies the entity.
Most of the time, settings take the arguments requested by the native WordPress function on which the code is based.
When this is not the case or when elements have been added, refer to the page dedicated to the entity via the menu in the sidebar of the wiki.
When a custom key is optional, it must still be declared but with an empty value.