Languages: English • 日本語 (Add your language)
The 'the_post
' action hook allows developers to modify the post object immediately after being queried and setup.
The post object is passed to this hook by reference so there is no need to return a value.
function my_the_post_action( $post_object ) {
// modify post object here
}
add_action( 'the_post', 'my_the_post_action' );
'the_post' action is located near the end of the setup_postdata() function in wp-includes/query.php
.