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

    r58718 r59244  
    729729require get_template_directory() . '/inc/customizer.php';
    730730
    731 // Add support for block patterns.
    732 require get_template_directory() . '/inc/block-patterns.php';
     731/**
     732 * Register block patterns and pattern categories.
     733 *
     734 * @since Twenty Fourteen 4.1
     735 */
     736function twentyfourteen_register_block_patterns() {
     737    require get_template_directory() . '/inc/block-patterns.php';
     738}
     739
     740add_action( 'init', 'twentyfourteen_register_block_patterns' );
    733741
    734742/*
Note: See TracChangeset for help on using the changeset viewer.