remove core block patterns and add 'JETT' pattern category
This commit is contained in:
		| @ -170,13 +170,22 @@ function jett_remove_current_from_queries( $query_vars, $block ) { | ||||
| } | ||||
| add_filter( 'query_loop_block_query_vars', 'jett_remove_current_from_queries', 10, 2 ); | ||||
|  | ||||
|  | ||||
| // Remove default block patterns | ||||
| add_action('init', function() { | ||||
| 	remove_theme_support('core-block-patterns'); | ||||
| },  9  ); | ||||
|  | ||||
|  | ||||
| // Register custom pattern categories | ||||
| function jett_pattern_categories() { | ||||
| if ( function_exists( 'register_block_pattern_category' ) ) { | ||||
| 	register_block_pattern_category( | ||||
| 		'jett', | ||||
| 		array( 'label' => __( 'JETT', 'jett' ) ) | ||||
| 	); | ||||
|  | ||||
| 	register_block_pattern_category( | ||||
| 		'jett_full_page_layouts', | ||||
| 		array( | ||||
| 			'label'       => _x( 'Pages', 'Block pattern category', 'jett' ), | ||||
| 			'description' => __( 'A collection of full page layouts.', 'jett' ), | ||||
| 		) | ||||
| 		array( 'label' => __( 'Page Layouts', 'jett' ) ) | ||||
| 	); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user