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/twentysixteen/functions.php

    r58718 r59244  
    529529require get_template_directory() . '/inc/template-tags.php';
    530530
    531 /**
    532  * Block Patterns.
    533  */
    534 require get_template_directory() . '/inc/block-patterns.php';
     531
     532/**
     533 * Register block patterns and pattern categories.
     534 *
     535 * @since Twenty Sixteen 3.4
     536 */
     537function twentysixteen_register_block_patterns() {
     538    require get_template_directory() . '/inc/block-patterns.php';
     539}
     540
     541add_action( 'init', 'twentysixteen_register_block_patterns' );
    535542
    536543/**
Note: See TracChangeset for help on using the changeset viewer.