[wp-trac] [WordPress Trac] #21931: White screen of death if theme can't be found
WordPress Trac
noreply at wordpress.org
Mon Jan 18 20:03:32 UTC 2016
#21931: White screen of death if theme can't be found
-------------------------+-----------------------
Reporter: ericlewis | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: 4.5
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+-----------------------
Changes (by ericlewis):
* keywords: dev-feedback 2nd-opinion =>
Comment:
Replying to [comment:39 sebastian.pisula]:
> But theme->erros return error if not exists index.php file so better
patch is:
>
> {{{#!php
> <?php
> if ( $template = apply_filters( 'template_include', $template ) )
{
> include( $template );
> } elseif ( current_user_can( 'install_themes' ) ) {
> wp_die( __( 'Template is missing.' ) );
> }
> }}}
Thanks for the suggestion here @sebastian.pisula!
This approach is more prone to break things. I could imagine plugins
purposefully filtering `template_include` to a falsy value to, say, output
some JSON (or who knows what else). Of course this is not what
template_include is intended for, but in support of backwards
compatibility, we should respect this functionality by displaying an error
only if there are issues with the theme, which is an exceptional problem
for the template loader.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21931#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list