Remove overkill restrictions
This literally just sorted blocks into categories.
This commit is contained in:
parent
9466b9d444
commit
90116227bd
@ -256,7 +256,6 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
|
||||
| `admin_body_class` | `fictioneer_addClassesToAdminBody`
|
||||
| `admin_comment_types_dropdown` | `fictioneer_add_private_to_comment_filter`
|
||||
| `allowed_block_types_all` | `fictioneer_allowed_block_types`, `fictioneer_restrict_block_types`
|
||||
| `block_categories_all` | `fictioneer_restrict_block_categories`
|
||||
| `body_class` | `fictioneer_addClassesToBody`
|
||||
| `cancel_comment_reply_link` | `__return_empty_string`
|
||||
| `comment_email` | `__return_false`
|
||||
|
@ -1213,32 +1213,6 @@ if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restricts the block categories available in the Gutenberg editor
|
||||
*
|
||||
* @return array Array of block categories.
|
||||
*/
|
||||
|
||||
function fictioneer_restrict_block_categories() {
|
||||
return array(
|
||||
array(
|
||||
'slug' => 'text',
|
||||
'title' => _x( 'Text', 'block category' ),
|
||||
'icon' => null,
|
||||
),
|
||||
array(
|
||||
'slug' => 'media',
|
||||
'title' => _x( 'Media', 'block category' ),
|
||||
'icon' => null,
|
||||
),
|
||||
array(
|
||||
'slug' => 'embed',
|
||||
'title' => _x( 'Embeds', 'block category' ),
|
||||
'icon' => null,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restricts the block types available in the Gutenberg editor
|
||||
*
|
||||
@ -1278,7 +1252,6 @@ if ( ! current_user_can( 'manage_options' ) ) {
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'fcn_all_blocks' ) ) {
|
||||
add_filter( 'block_categories_all', 'fictioneer_restrict_block_categories', 9999 );
|
||||
add_filter( 'allowed_block_types_all', 'fictioneer_restrict_block_types', 9999 );
|
||||
add_filter( 'wp_insert_post_data', 'fictioneer_remove_restricted_block_content', 9999 );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user