[wp-trac] [WordPress Trac] #47114: global $pages not available on the_post action

WordPress Trac noreply at wordpress.org
Sat May 4 20:52:26 UTC 2019


#47114: global $pages not available on the_post action
-------------------------------+-----------------------
 Reporter:  david.binda        |       Owner:  azaozz
     Type:  defect (bug)       |      Status:  assigned
 Priority:  highest omg bbq    |   Milestone:  5.2
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  has-patch commit   |     Focuses:
-------------------------------+-----------------------

Comment (by azaozz):

 > I think the anonymous function should be taken out.
 ...
 > I think this usage of an anonymous function is fine and having a test is
 better than no test.

 The problem with using an anonymous function in an action or a filter is
 that it "breaks the API" and makes it impossible to remove. This is not a
 problem for tests as hooks there are generally non-removable by plugins,
 but the coding standards explicitly forbid that use, especially in core.

 Think we should keep the test but change it to a non-lambda callback.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47114#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list