Make WordPress Core


Ignore:
Timestamp:
10/17/2024 12:35:01 AM (5 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/twentyten/functions.php

    r59219 r59244  
    782782add_action( 'enqueue_block_editor_assets', 'twentyten_block_editor_styles' );
    783783
    784 // Block Patterns.
    785 require get_template_directory() . '/block-patterns.php';
     784/**
     785 * Register block patterns and pattern categories.
     786 *
     787 * @since Twenty Ten 4.3
     788 */
     789function twentyten_register_block_patterns() {
     790    require get_template_directory() . '/block-patterns.php';
     791}
     792
     793add_action( 'init', 'twentyten_register_block_patterns' );
    786794
    787795if ( ! function_exists( 'wp_body_open' ) ) :
Note: See TracChangeset for help on using the changeset viewer.