Make WordPress Core

Changeset 56757


Ignore:
Timestamp:
10/02/2023 10:40:36 PM (5 months ago)
Author:
danielbachhuber
Message:

Editor: Add function prefix to avoid conflicts.

Transforms initialize_theme_preview_hooks to wp_initialize_theme_preview_hooks to avoid conflicts with third-party code.

Follow up to [56529].

Props okat.
See #59000.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r56714 r56757  
    532532
    533533// Block Theme Previews.
    534 add_action( 'plugins_loaded', 'initialize_theme_preview_hooks', 1 );
     534add_action( 'plugins_loaded', 'wp_initialize_theme_preview_hooks', 1 );
    535535
    536536// Calendar widget cache.
  • trunk/src/wp-includes/theme-previews.php

    r56529 r56757  
    8484 * @since 6.3.2
    8585 */
    86 function initialize_theme_preview_hooks() {
     86function wp_initialize_theme_preview_hooks() {
    8787    if ( ! empty( $_GET['wp_theme_preview'] ) ) {
    8888        add_filter( 'stylesheet', 'wp_get_theme_preview_path' );
  • trunk/tests/phpunit/tests/theme-previews.php

    r56529 r56757  
    1818    public function test_initialize_theme_preview_hooks() {
    1919        $_GET['wp_theme_preview'] = 'twentytwentythree';
    20         do_action( 'plugins_loaded' ); // Ensure `plugins_loaded` triggers `initialize_theme_preview_hooks`.
     20        do_action( 'plugins_loaded' ); // Ensure `plugins_loaded` triggers `wp_initialize_theme_preview_hooks`.
    2121
    2222        $this->assertEquals( has_filter( 'stylesheet', 'wp_get_theme_preview_path' ), 10 );
Note: See TracChangeset for help on using the changeset viewer.