Skip to content

Commit a1852bd

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56757 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bc259dd commit a1852bd

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-includes/default-filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@
531531
add_action( 'transition_post_status', '_wp_keep_alive_customize_changeset_dependent_auto_drafts', 20, 3 );
532532

533533
// Block Theme Previews.
534-
add_action( 'plugins_loaded', 'initialize_theme_preview_hooks', 1 );
534+
add_action( 'plugins_loaded', 'wp_initialize_theme_preview_hooks', 1 );
535535

536536
// Calendar widget cache.
537537
add_action( 'save_post', 'delete_get_calendar_cache' );

src/wp-includes/theme-previews.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function wp_block_theme_activate_nonce() {
8383
*
8484
* @since 6.3.2
8585
*/
86-
function initialize_theme_preview_hooks() {
86+
function wp_initialize_theme_preview_hooks() {
8787
if ( ! empty( $_GET['wp_theme_preview'] ) ) {
8888
add_filter( 'stylesheet', 'wp_get_theme_preview_path' );
8989
add_filter( 'template', 'wp_get_theme_preview_path' );

tests/phpunit/tests/theme-previews.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function tear_down() {
1717

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 );
2323
$this->assertEquals( has_filter( 'template', 'wp_get_theme_preview_path' ), 10 );

0 commit comments

Comments
 (0)