Repository navigation
Fix: Clear theme cache after adding extra_theme_headers - #495
CookieDarb wants to merge 2 commits into
Conversation
|
At Theme Check’s Could the refresh run only for a submitted check and be limited to the selected theme? A matched active-theme test would help confirm that the License fields still appear with the narrower scope. I have not measured runtime cost or tested this in WordPress, so this is a question about cache scope, not evidence of a performance regression. |
|
Thanks for the feedback! I've updated the PR to address both the points:
|
|
Thanks for narrowing the refresh. I tested the active-theme case against base This exercised the plugin’s admin-page and check methods with synthetic themes using PHP 8.4.27 via WebAssembly and SQLite. I didn’t test browser rendering, native hosting, or performance. |
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.