Opened 12 years ago
Closed 12 years ago
#20921 closed defect (bug) (fixed)
Customizer should check theme errors(), not just exists()
Reported by: | nacin | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
wp-admin/customize.php checks that a theme exists. It should actually check that the theme is error-free.
Note that we need to make a determination for what happens when the current theme has errors. In some cases, this will cause a reversion to the default theme, but not always (search for 'theme_parent_invalid' in class-wp-theme.php).
Attachments (4)
Change History (12)
#2
@
12 years ago
20921.2.diff moves the validate_current_theme() check to after_setup_theme, as validate_current_theme() requires both TEMPLATEPATH and STYLESHEETPATH to be set. setup_theme()'s branching and procedural flow is now pretty much completely re-organized, and I think it's much more clean now.
#5
@
12 years ago
_save_feedback() is not implemented correctly, which means this string is lost to the abyss. Also, if you have a lot of themes, then the code that moves div.updated's to below h2's doesn't fire for a while, causing it to jump. In some situations (such as when the admin_notices hook isn't used) there isn't a good workaround, but in this case, we can simply move that code block.
The diff within the code block won't show up easily, but you can see that this was added:
if ( isset( $_GET['previewed'] ) ) { ?> <div id="message2" class="updated"><p><?php printf( __( 'Settings saved and theme activated. <a href="%s">Visit site</a>.' ), home_url( '/' ) ); ?></p></div> <?php } elseif
So much nicer than the "this theme has widgets" string with the comma splice.
20921.diff does a number of distinct things, so listen up:
What it does and why: