- Timestamp:
- 10/22/2024 01:41:10 AM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwentyfive/functions.php
r59146 r59269 20 20 */ 21 21 function twentytwentyfive_post_format_setup() { 22 add_theme_support( 'post-formats', array( 'a udio', 'gallery', 'image', 'link', 'quote', 'video' ) );22 add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); 23 23 } 24 24 endif; … … 122 122 if ( ! function_exists( 'twentytwentyfive_register_block_bindings' ) ) : 123 123 /** 124 * Registers the copyright block binding source.124 * Registers the post format block binding source. 125 125 * 126 126 * @since Twenty Twenty-Five 1.0 … … 130 130 function twentytwentyfive_register_block_bindings() { 131 131 register_block_bindings_source( 132 'twentytwentyfive/ copyright',132 'twentytwentyfive/format', 133 133 array( 134 'label' => _x( ' © YEAR', 'Label for the copyrightplaceholder in the editor', 'twentytwentyfive' ),135 'get_value_callback' => 'twentytwentyfive_ copyright_binding',134 'label' => _x( 'Post format name', 'Label for the block binding placeholder in the editor', 'twentytwentyfive' ), 135 'get_value_callback' => 'twentytwentyfive_format_binding', 136 136 ) 137 137 ); 138 138 } 139 139 endif; 140 add_action( 'init', 'twentytwentyfive_register_block_bindings' ); 140 141 141 // Registers block binding callback function for the copyright.142 if ( ! function_exists( 'twentytwentyfive_ copyright_binding' ) ) :142 // Registers block binding callback function for the post format name. 143 if ( ! function_exists( 'twentytwentyfive_format_binding' ) ) : 143 144 /** 144 * Callback function for the copyrightblock binding source.145 * Callback function for the post format name block binding source. 145 146 * 146 147 * @since Twenty Twenty-Five 1.0 147 148 * 148 * @return string Copyright text.149 * @return string|void Post format name, or nothing if the format is 'standard'. 149 150 */ 150 function twentytwentyfive_copyright_binding() { 151 $copyright_text = sprintf( 152 /* translators: 1: Copyright symbol or word, 2: Year */ 153 esc_html__( '%1$s %2$s', 'twentytwentyfive' ), 154 '©', 155 wp_date( 'Y' ) 156 ); 151 function twentytwentyfive_format_binding() { 152 $post_format_slug = get_post_format(); 157 153 158 return $copyright_text; 154 if ( $post_format_slug && 'standard' !== $post_format_slug ) { 155 return get_post_format_string( $post_format_slug ); 156 } 159 157 } 160 158 endif; 161 add_action( 'init', 'twentytwentyfive_register_block_bindings' );
Note: See TracChangeset
for help on using the changeset viewer.