do_action_ref_array( 'the_post', WP_Post $post, WP_Query $query )
- Since
- 2.8.0, 4.1.0
Fires once the post data has been set up.
Compatibility
- WordPress
- since 4.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$postWP_Post- The Post object (passed by reference).
$queryWP_Query- The current Query object (passed by reference).
Where this hook fires · 1
wp-includes/class-wp-query.php:4891WP_Query::setup_postdata()
Source code
* @since 2.8.0 * @since 4.1.0 Introduced `$query` parameter. * * @param WP_Post $post The Post object (passed by reference). * @param WP_Query $query The current Query object (passed by reference). */ do_action_ref_array( 'the_post', array( &$post, &$this ) ); return true; } /** * Generates post data.Changelog
Introduced in 4.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.1.0
Introduced
$query parameter.from the docblock2.8.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.