get( 'Version' ) ); } endif; add_action( 'wp_enqueue_scripts', 'bigblocks_enqueue_styles' ); // Registers custom block styles. if ( ! function_exists( 'bigblocks_block_styles' ) ) : /** * Registers custom block styles. * * @since BigBlocks 1.0 * * @return void */ function bigblocks_block_styles() { register_block_style( 'core/list', array( 'name' => 'checkmark-list', 'label' => esc_html__( 'Checkmark', 'bigblocks' ), 'inline_style' => ' ul.is-style-checkmark-list { list-style-type: "\2713"; } ul.is-style-checkmark-list li { padding-inline-start: 1ch; }', ) ); } endif; add_action( 'init', 'bigblocks_block_styles' ); // Registers pattern categories. if ( ! function_exists( 'bigblocks_pattern_categories' ) ) : /** * Registers pattern categories. * * @since BigBlocks 1.0 * * @return void */ function bigblocks_pattern_categories() { register_block_pattern_category( 'bigblocks_page', array( 'label' => esc_html__( 'Pages', 'bigblocks' ), 'description' => esc_html__( 'A collection of full page layouts.', 'bigblocks' ), ) ); register_block_pattern_category( 'bigblocks_post-format', array( 'label' => esc_html__( 'Post formats', 'bigblocks' ), 'description' => esc_html__( 'A collection of post format patterns.', 'bigblocks' ), ) ); } endif; add_action( 'init', 'bigblocks_pattern_categories' ); /** * Registers pattern categories. * * @since BigBlocks 1.0 * * @return void */ function bigblocks_register_pattern_category() { $patterns = array(); $block_pattern_categories = array( 'bigblocks' => array( 'label' => esc_html__( 'BigBlocks Theme', 'bigblocks' ) ) ); $block_pattern_categories = apply_filters( 'bigblocks_block_pattern_categories', $block_pattern_categories ); foreach ( $block_pattern_categories as $name => $properties ) { if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) { register_block_pattern_category( $name, $properties ); } } } add_action( 'init', 'bigblocks_register_pattern_category', 9 ); // Registers block binding sources. if ( ! function_exists( 'bigblocks_register_block_bindings' ) ) : /** * Registers the post format block binding source. * * @since BigBlocks 1.0 * * @return void */ function bigblocks_register_block_bindings() { register_block_bindings_source( 'bigblocks/format', array( 'label' => _x( 'Post format name', 'Label for the block binding placeholder in the editor', 'bigblocks' ), 'get_value_callback' => 'bigblocks_format_binding', ) ); } endif; add_action( 'init', 'bigblocks_register_block_bindings' ); // Registers block binding callback function for the post format name. if ( ! function_exists( 'bigblocks_format_binding' ) ) : /** * Callback function for the post format name block binding source. * * @since BigBlocks 1.0 * * @return string|void Post format name, or nothing if the format is 'standard'. */ function bigblocks_format_binding() { $post_format_slug = get_post_format(); if ( $post_format_slug && 'standard' !== $post_format_slug ) { return get_post_format_string( $post_format_slug ); } } endif;