| @@ -40,13 +40,23 @@ | ||
| 40 | 40 | * @param array<int, array<string, mixed>> $categories Existing block categories. |
| 41 | 41 | * @param \WP_Block_Editor_Context $context The block editor context. |
| 42 | 42 | * @return array<int, array<string, mixed>> Modified block categories. |
| 43 | 43 | */ |
| 44 | - public function register_block_category( array $categories, \WP_Block_Editor_Context $context ): array { | |
| 45 | - $new_category = array( | |
| 46 | - 'slug' => 'slider-blocks', | |
| 44 | + // public function register_block_category( array $categories, \WP_Block_Editor_Context $context ): array { | |
| 45 | + // $new_category = array( | |
| 46 | + // 'slug' => 'slider-blocks', | |
| 47 | + // 'title' => __( 'GutSlider Blocks', 'slider-blocks' ), | |
| 48 | + // ); | |
| 49 | + | |
| 50 | + // return array_merge( array( $new_category ), $categories ); | |
| 51 | + // } | |
| 52 | + | |
| 53 | + public function register_block_category( $categories, $post ) { | |
| 54 | + | |
| 55 | + array_unshift( $categories, array( | |
| 56 | + 'slug' => 'slider-blocks', | |
| 47 | 57 | 'title' => __( 'GutSlider Blocks', 'slider-blocks' ), |
| 48 | - ); | |
| 58 | + ) ); | |
| 49 | 59 | |
| 50 | - return array_merge( array( $new_category ), $categories ); | |
| 60 | + return $categories; | |
| 51 | 61 | } |
| 52 | 62 | } |