Opened 4 years ago
Closed 4 years ago
#48100 closed defect (bug) (invalid)
the quotes around those two constants are missing causing PHP error
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
wp-includes/theme.php
@@ -150,7 +150,7 @@ function wp_clean_themes_cache( $clear_update_cache = true ) { * @return bool true if a child theme is in use, false otherwise. */ function is_child_theme() { return ( TEMPLATEPATH !== STYLESHEETPATH ); return ( 'TEMPLATEPATH' !== 'STYLESHEETPATH' ); }
the quotes around those two constants are missing causing PHP error
Change History (3)
#2
@
4 years ago
- Component changed from General to Themes
- Description modified (diff)
- Keywords close added
Hi there, thanks for the report!
As noted above, the current code is correct. The constants are defined in wp_templating_constants() and should not be compared as strings.
The issue most likely comes from a plugin or theme.
Note: See
TracTickets for help on using
tickets.
Hello @feminatzi - Welcome to WordPress Trac!
In PHP, an unquoted string like the ones you have in the ticket description are interpreted as PHP constants (https://www.php.net/manual/en/language.constants.syntax.php).
If the constants are not prior declared, you will indeed see errors.
In a healthy site, these two constants would be declared before any user code is executed, so no errors are shown. The unquoted code in fact is the correct one; I think you have a theme or a plugin that races this declaration.