'Title', 'slug' => 'Slug', 'categories' => 'Categories', 'keywords' => 'Keywords', 'description' => 'Description', ) ); if (empty($pattern_data['slug'])) { continue; } // Load pattern content. ob_start(); include $pattern_file; $pattern_content = ob_get_clean(); // Parse categories and keywords. $categories = !empty($pattern_data['categories']) ? array_filter(array_map('trim', explode(',', $pattern_data['categories']))) : array(); $keywords = !empty($pattern_data['keywords']) ? array_filter(array_map('trim', explode(',', $pattern_data['keywords']))) : array(); // Register the block pattern. register_block_pattern( $pattern_data['slug'], array( 'title' => !empty($pattern_data['title']) ? $pattern_data['title'] : '', 'content' => $pattern_content, 'categories' => $categories, 'keywords' => $keywords, 'description' => !empty($pattern_data['description']) ? $pattern_data['description'] : '', ) ); } } } add_action('init', 'breezi_blog_register_block_patterns'); /** * Register custom block styles. * * @return void */ if (!function_exists('breezi_blog_register_block_styles')) { function breezi_blog_register_block_styles(): void { // Button Block: Rounded style. register_block_style( 'core/button', array( 'name' => 'rounded-button', 'label' => __('Rounded', 'breezi-blog'), ) ); // Button Block: Square style. register_block_style( 'core/button', array( 'name' => 'square-button', 'label' => __('Square', 'breezi-blog'), ) ); // Image Block: Shadow style. register_block_style( 'core/image', array( 'name' => 'image-shadow', 'label' => __('With Shadow', 'breezi-blog'), ) ); // Quote Block: Minimal style. register_block_style( 'core/quote', array( 'name' => 'minimal-quote', 'label' => __('Minimal', 'breezi-blog'), ) ); // List Block: Checkmark style. register_block_style( 'core/list', array( 'name' => 'checkmark-list', 'label' => __('Checkmark', 'breezi-blog'), ) ); } } add_action('init', 'breezi_blog_register_block_styles');