Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#45642 closed defect (bug) (invalid)

function is_child_theme() bug

Reported by: samet5 Owned by:
Priority: normal Milestone:
Component: Themes Version: 5.0.1
Severity: normal Keywords:
Cc: Focuses:

Description

<?php
function is_child_theme() {
        return ( TEMPLATEPATH !== STYLESHEETPATH );
}

needs to get replaced in:

<?php
function is_child_theme() {
        return ( 'TEMPLATEPATH' !== 'STYLESHEETPATH' );
}

Change History (4)

#1 @samet5
8 years ago

/wp-includes/theme.php

#2 @swissspidy
8 years ago

  • Keywords ? removed
  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

Hi, and welcome to WordPress Trac!

Why do you think this needs to be changed?

TEMPLATEPATH !== STYLESHEETPATH compares the two constants TEMPLATEPATH and STYLESHEETPATH, which can have any value.

On the other hand, 'TEMPLATEPATH' !== 'STYLESHEETPATH' compares the two strings "TEMPLATEPATH" and "STYLESHEETPATH", which will never be the same.

#3 @samet5
8 years ago

I think this will not work in newer php versions

#4 @SergeyBiryukov
8 years ago

Comparing constants should work in any PHP version, I don't see an issue here.

Note: See TracTickets for help on using tickets.