Add: wp_global_styles custom post type.

This commit adds the wp_global_styles custom post type following the same approach used to add other core custom post types. It also updates the wp_theme taxonomy to include the wp_global_styles post type.
The post type is registered in the same way it is on the plugin we just adapt the location for the core.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52041


git-svn-id: http://core.svn.wordpress.org/trunk@51633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
jorgefilipecosta 2021-11-08 14:26:00 +00:00
parent 3d10105120
commit 0b4ecc9b23
3 changed files with 29 additions and 2 deletions

View File

@ -365,6 +365,33 @@ function create_initial_post_types() {
)
);
register_post_type(
'wp_global_styles',
array(
'label' => __( 'Global Styles', 'gutenberg' ),
'description' => 'CPT to store user design tokens',
'public' => false,
'show_ui' => false,
'show_in_rest' => false,
'rewrite' => false,
'capabilities' => array(
'read' => 'edit_theme_options',
'create_posts' => 'edit_theme_options',
'edit_posts' => 'edit_theme_options',
'edit_published_posts' => 'edit_theme_options',
'delete_published_posts' => 'edit_theme_options',
'edit_others_posts' => 'edit_theme_options',
'delete_others_posts' => 'edit_theme_options',
),
'map_meta_cap' => true,
'supports' => array(
'title',
'editor',
'revisions',
),
)
);
register_post_status(
'publish',
array(

View File

@ -175,7 +175,7 @@ function create_initial_taxonomies() {
register_taxonomy(
'wp_theme',
array( 'wp_template' ),
array( 'wp_template', 'wp_global_styles' ),
array(
'public' => false,
'hierarchical' => false,

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-52040';
$wp_version = '5.9-alpha-52041';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.