Created
April 27, 2019 02:26
-
-
Save pbrocks/55ae039082dc1cccf912810d9ffe1bdc to your computer and use it in GitHub Desktop.
PHP snippet to add a panel to the WP Block Inserter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adding a block category creates a Panel | |
*/ | |
function create_wclancpa_2019_panel( $categories, $post ) { | |
return array_merge( | |
$categories, | |
array( | |
array( | |
'slug' => 'wclancpa-2019', | |
'title' => __( 'WC Lancaster 2019 Panel', 'wclancpa-2019' ), | |
), | |
) | |
); | |
} | |
add_filter( 'block_categories', 'create_wclancpa_2019_panel', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment