Make WordPress Core


Ignore:
Timestamp:
10/22/2024 01:41:10 AM (7 weeks ago)
Author:
peterwilsoncc
Message:

Bundled Themes: Update Twenty Twenty-Five for 6.7 RC 1.

This merges the latest improvements to the Twenty Twenty-Five theme from GitHub into trunk for 6.7 RC 1.

A full list of changes can be found on GitHub: WordPress/twentytwentyfive@e4da8ad...f2dc3fa

Props juanfra, poena, beafialho, areziaal, joen, sergeybiryukov, richtabor, cwhitmore, get_dave, talldanwp, andraganescu, kau-boy, mhkuu, hanneslsm, alaminfirdows, dd32.
See #62264.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyfive/functions.php

    r59146 r59269  
    2020     */
    2121    function twentytwentyfive_post_format_setup() {
    22         add_theme_support( 'post-formats', array( 'audio', 'gallery', 'image', 'link', 'quote', 'video' ) );
     22        add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) );
    2323    }
    2424endif;
     
    122122if ( ! function_exists( 'twentytwentyfive_register_block_bindings' ) ) :
    123123    /**
    124      * Registers the copyright block binding source.
     124     * Registers the post format block binding source.
    125125     *
    126126     * @since Twenty Twenty-Five 1.0
     
    130130    function twentytwentyfive_register_block_bindings() {
    131131        register_block_bindings_source(
    132             'twentytwentyfive/copyright',
     132            'twentytwentyfive/format',
    133133            array(
    134                 'label'              => _x( '© YEAR', 'Label for the copyright placeholder 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',
    136136            )
    137137        );
    138138    }
    139139endif;
     140add_action( 'init', 'twentytwentyfive_register_block_bindings' );
    140141
    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.
     143if ( ! function_exists( 'twentytwentyfive_format_binding' ) ) :
    143144    /**
    144      * Callback function for the copyright block binding source.
     145     * Callback function for the post format name block binding source.
    145146     *
    146147     * @since Twenty Twenty-Five 1.0
    147148     *
    148      * @return string Copyright text.
     149     * @return string|void Post format name, or nothing if the format is 'standard'.
    149150     */
    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();
    157153
    158         return $copyright_text;
     154        if ( $post_format_slug && 'standard' !== $post_format_slug ) {
     155            return get_post_format_string( $post_format_slug );
     156        }
    159157    }
    160158endif;
    161 add_action( 'init', 'twentytwentyfive_register_block_bindings' );
Note: See TracChangeset for help on using the changeset viewer.