Make WordPress Core


Ignore:
Timestamp:
10/17/2024 12:35:01 AM (3 months ago)
Author:
peterwilsoncc
Message:

Bundled Themes: Avoid loading translations too early.

Load block patterns for bundled themes on the init hook to avoid triggering notices caused by loading the translations too early.

The change is applied to Twenty Ten, Twenty Twelve, Twenty Thirteen, Twenty Fourteen, Twenty Fifteen, Twenty Sixteen and Twenty Twenty.

Props domainsupport, swissspidy.
Fixes #62237.
See #44937.

File:
1 edited

Legend:

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

    r58718 r59244  
    141141
    142142/**
    143  * Add block patterns.
    144  */
    145 require get_template_directory() . '/inc/block-patterns.php';
     143 * Register block patterns and pattern categories.
     144 *
     145 * @since Twenty Twelve 4.4
     146 */
     147function twentytwelve_register_block_patterns() {
     148    require get_template_directory() . '/inc/block-patterns.php';
     149}
     150
     151add_action( 'init', 'twentytwelve_register_block_patterns' );
    146152
    147153if ( ! function_exists( 'twentytwelve_get_font_url' ) ) :
Note: See TracChangeset for help on using the changeset viewer.