[wp-trac] [WordPress Trac] #46679: Themes: Add a shim for wp_body_open()
WordPress Trac
noreply at wordpress.org
Tue Apr 2 23:02:50 UTC 2019
#46679: Themes: Add a shim for wp_body_open()
-------------------------------------+------------------------------
Reporter: pento | Owner: adamsilverstein
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.2
Component: Bundled Theme | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch needs-refresh | Focuses:
-------------------------------------+------------------------------
Changes (by pento):
* keywords: has-patch 2nd-opinion => has-patch needs-refresh
Comment:
Yah, I like the direction of [attachment:"46679-back-comp.patch"]. The
function shouldn't go in `inc/back-compat.php`, though, as that file is
only loaded on versions of WordPress where the theme won't work, and it'll
prevent the theme from being activated. Where the file exists, lets put it
in `inc/template-tags.php`.
To address the other options:
- I think the `wp_body_open()` function call fits better with the
`wp_head()` / `wp_footer()` pattern. Particularly as this is the actual
function call that works in WP 5.2+, using a `do_action()` call solely for
back compat is presenting a sub-optimal example for folks to base their
themes off.
- Adding a `function_exists( 'wp_body_open' )` check is an unnecessary
logic check in a template file, which should be avoided where possible.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46679#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list