[wp-trac] [WordPress Trac] #54288: Argument for allowed blocks when registering a post type
WordPress Trac
noreply at wordpress.org
Tue Oct 19 08:54:12 UTC 2021
#54288: Argument for allowed blocks when registering a post type
------------------------------+-----------------------------
Reporter: smeedijzeronline | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords:
Focuses: |
------------------------------+-----------------------------
Add argument for allowed blocks when registering a post type:
{{{
function wporg_custom_post_type() {
register_post_type('wporg_product',
array(
'labels' => array(
'name' => __('Products', 'textdomain'),
'singular_name' => __('Product', 'textdomain'),
),
'public' => true,
'has_archive' => true,
'allowed_blocks' => array(
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/embed',
'core/missing',
'core/button',
'core/buttons',
),
)
);
}
add_action('init', 'wporg_custom_post_type');
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54288>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list