[wp-trac] [WordPress Trac] #40796: Overriding WordPress globals is prohibited
WordPress Trac
noreply at wordpress.org
Thu May 18 07:33:51 UTC 2017
#40796: Overriding WordPress globals is prohibited
-----------------------------+------------------------------
Reporter: maneshtimilsina | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: 4.7.5
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by swissspidy):
Hey there,
Thanks for your report and welcome to Trac!
They way themes like Twenty Seventeen need to set up front page sections,
overriding `$post` is really to only way.
What isn't needed is the first `global $post` on line 142. Also, before
the global post is set, it's not really checked if `get_theme_mod(
'panel_' . $id )` really is a valid post.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40796#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list