Changing order of block categories
-
I have some custom blocks created that are organized into three categories. These three categories appear at the bottom of the list of block categories in the editor. I’m wondering if anyone knows how to change the order that the custom categories appear in the list so I can make them appear at the top or in a specific place?
function my_plugin_block_categories( $categories, $post ) { if ( $post->post_type !== 'page' ) { return $categories; } return array_merge( $categories, array( array( 'slug' => 'category-dr', 'title' => __( 'DragonRidge Blocks', 'my-plugin' ), //'icon' => 'admin-home', ), array( 'slug' => 'dr-dashboard', 'title' => __( 'DragonRidge Dashboard', 'my-plugin' ), //'icon' => 'admin-home', ), array( 'slug' => 'category-home', 'title' => __( 'DragonRidge Home Page', 'my-plugin' ), //'icon' => 'admin-home', ), ) ); } add_filter( 'block_categories', 'my_plugin_block_categories', 10, 2 );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Changing order of block categories’ is closed to new replies.