WordPress.org

Make WordPress Core

Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#46325 closed defect (bug) (duplicate)

wp 5.1 broke some themes working perfectly before, cause found

Reported by: bufny Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: General Keywords:
Focuses: Cc:

Description

In wp-settings.php from wp5.1 there are the following lines of code (not present before):

<?php

// Load the functions for the active theme, for both parent and child theme if applicable.
foreach ( wp_get_active_and_valid_themes() as $theme ) {
        if ( file_exists( $theme . '/functions.php' ) ) {
                include $theme . '/functions.php';
        }
}
unset( $theme );

If the active theme is using the $theme as a global variable things mess up. I don't know who should refactor this (the wp core team or the hundreds theme creators), but the name of the variable here is unfortunately chosen.

Change History (4)

#1 @bufny
19 months ago

  • Summary changed from wp 5.1 brake some themes working perfectly before, cause found to wp 5.1 broke some themes working perfectly before, cause found

#2 @TimothyBlynJacobs
19 months ago

  • Resolution set to duplicate
  • Status changed from new to closed

Thank you for the report bufny, we're already tracking this issue in #46313

This ticket was mentioned in Slack in #forums by tobifjellner. View the logs.


19 months ago

#4 @desrosj
19 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.