[wp-trac] [WordPress Trac] #33045: New conditional tags for child/parent pages

WordPress Trac noreply at wordpress.org
Mon Feb 1 17:56:00 UTC 2021


#33045: New conditional tags for child/parent pages
-------------------------------------------------+-------------------------
 Reporter:  ramiy                                |       Owner:  audrasjb
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.7
Component:  Posts, Post Types                    |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-dev-note needs-docs  |     Focuses:  template
  has-unit-tests commit                          |
-------------------------------------------------+-------------------------

Comment (by johnbillion):

 This looks good. [attachment:"33045.diff"] just tweaks the docs and
 switches to using the post factory in the tests.

 One remaining concern that I haven't seen mentioned yet is whether any
 existing plugins or themes already define either a `get_parent_post()` or
 `has_parent_post()` function. If they do, a fatal error will occur in 5.7.

 I checked the plugin and theme directories and (amazingly?) only one
 plugin is affected,[https://wordpress.org/plugins/revisionize/
 Revisionize] with 6,000 active installations, and it defines the
 `get_parent_post()` function. No themes are affected.

 I think we can reach out to the plugin author and ask them to update the
 plugin with a `function_exists()` check. If it's absolutely necessary we
 can ask the plugin team to push out an update with that change before 5.7.

 Unless anybody disagrees, I'll commit this this evening.

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


More information about the wp-trac mailing list