Fix: Clear theme cache after adding extra_theme_headers#495
Open
CookieDarb wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #494
This PR ensures that the "License" and "License URI" fields are correctly displayed in the Theme Info summary box when checking the currently active theme.
Why?
When Theme Check is run against the currently active theme, the "License" and "License URI" fields are missing from the visual summary box at the top of the WP Admin page. This occurs because WordPress caches the active theme's
WP_Themeobject early during initialization, long before Theme Check hooks into theextra_theme_headersfilter to register these license fields.How?
This PR:
wp_clean_themes_cache( false );immediately after registering theextra_theme_headersfilter intheme-check.php.wp_get_theme()to re-parse the active theme, successfully capturing the new headers.Testing Instructions
License:andLicense URI:defined in itsstyle.cssLicenseandLicense URIfields are now correctly displayed in the summary box.