get( 'Version' ) ); // Enqueue theme stylesheet. wp_enqueue_style( 'dosha-style' ); } endif; add_action( 'wp_enqueue_scripts', 'dosha_styles' ); if ( ! function_exists( 'dosha_block_pattern_categories' ) ) : /** * Registers the block pattern categories used by the theme. * * @since Dosha 1.0 * @return void */ function dosha_block_pattern_categories() { register_block_pattern_category( 'dosha', array( 'label' => _x( 'Dosha', 'Block pattern category', 'dosha' ), 'description' => __( 'Patterns that ship with the Dosha theme.', 'dosha' ), ) ); } endif; add_action( 'init', 'dosha_block_pattern_categories', 9 ); if ( ! function_exists( 'dosha_block_styles' ) ) : /** * Registers the Rounded block style for image blocks. * * Core already registers it for core/image, but not for the featured image * or avatar blocks, so it is added here to keep every image in the theme * sharing one style variation. * * @since Dosha 1.0 * @return void */ function dosha_block_styles() { $dosha_rounded_blocks = array( 'core/avatar', 'core/post-featured-image', ); foreach ( $dosha_rounded_blocks as $dosha_rounded_block ) { register_block_style( $dosha_rounded_block, array( 'name' => 'rounded', 'label' => __( 'Rounded', 'dosha' ), ) ); } } endif; add_action( 'init', 'dosha_block_styles' ); if ( ! function_exists( 'dosha_block_stylesheets' ) ) : /** * Enqueue custom block stylesheets. * * @since dosha 1.0 * @return void */ function dosha_block_stylesheets() { $dosha_styled_blocks = array( 'core/accordion' => 'accordion', 'core/avatar' => 'avatar', 'core/calendar' => 'calendar', 'core/image' => 'image', 'core/post-featured-image' => 'post-featured-image', 'core/table' => 'table', ); foreach ( $dosha_styled_blocks as $block_name_with_namespace => $block_name ) { wp_enqueue_block_style( $block_name_with_namespace, array( 'handle' => 'dosha-' . $block_name, 'src' => get_template_directory_uri() . '/assets/css/blocks/' . $block_name . '.css', 'path' => get_template_directory() . '/assets/css/blocks/' . $block_name . '.css', ) ); } } endif; add_action( 'init', 'dosha_block_stylesheets' );