[wp-trac] [WordPress Trac] #42927: Introduce the wp_body() function that fires the `wp_body` action
WordPress Trac
noreply at wordpress.org
Sun Dec 17 17:01:39 UTC 2017
#42927: Introduce the wp_body() function that fires the `wp_body` action
-------------------------+-----------------------------
Reporter: ramiy | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
When we want to add scripts & styles on the frontend, we can hook either
to the `wp_head` action or to the `wp_footer` action.
The [https://developer.wordpress.org/reference/functions/wp_head/
wp_head()] function introduced in WordPress 1.2.0, it fires the
[https://developer.wordpress.org/reference/hooks/wp_head/ wp_head] action
hook that adds data to the `<head>` tag.
The [https://developer.wordpress.org/reference/functions/wp_footer/
wp_footer()] function introduced in WordPress 1.5.1, it fires the
[https://developer.wordpress.org/reference/hooks/wp_footer/ wp_footer]
action hook that adds data to the ''end'' of the `<body>` tag.
Currently we can't add data to the ''beginning'' of the `<body>` tag.
WordPress should have a way to allow developers to add data to the
beginning of the body.
{{{
<html>
<head>
..
..
<?php wp_head(); ?>
</head>
<body>
<?php wp_body(); ?>
..
..
<?php wp_footer(); ?>
</body>
</html>
}}}
It's a good improvement for WordPress 5.0.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42927>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list