Opened 12 years ago
Closed 12 years ago
#23170 closed defect (bug) (fixed)
PHP Notice On _remove_theme_support() function
Reported by: | alex-ye | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Warnings/Notices | Keywords: | has-patch commit |
Focuses: | Cc: |
Description (last modified by )
I create a ticket about this bug in #22246 but as I test the PHP notice is still exists even after Nacin patch .
Attachments (3)
Change History (11)
#2
follow-up:
↓ 4
@
12 years ago
- Milestone changed from Awaiting Review to 3.6
theme.php.2.patch would re-introduce a part of [22274], which was reverted in [22312] and replaced with [22313].
However, seems like the check in [22313] was inaccurate: did_action()
can only return an integer. 23170.patch fixes the condition.
#4
in reply to:
↑ 2
;
follow-up:
↓ 5
@
12 years ago
Replying to SergeyBiryukov:
However, seems like the check in [22313] was inaccurate:
did_action()
can only return an integer. 23170.patch fixes the condition.
Good , but I have a tiny question why we check $support[0]wp-head-callback? in line 1495 it is not a boolean var and we should use empty() or isset() ... right ?!
And what about the line 1505 we don't check $support[0]wp-head-callback? at all , so what is the difference ?!
after all I want to learn more from you guys :)
#5
in reply to:
↑ 4
@
12 years ago
Replying to alex-ye:
why we check $support[0]wp-head-callback? in line 1495 it is not a boolean var and we should use empty() or isset() ... right ?!
Yes, we just skip !empty()
for brevity, since a non-empty string is considered true
:
http://php.net/manual/en/language.types.boolean.php
And what about the line 1505 we don't check $support[0]wp-head-callback? at all , so what is the difference ?!
I guess the difference is that unlike custom header, custom background has a default callback:
http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/theme.php#L1353
Using isset() to avoid the PHP notice .