I need to run a function for set some tags via post id when a post loaded. Is there any hook that lets me check post id when the post loaded ?
Action hook you are looking for is the_post. This hook is fired after post object is created.
Quick example:
<?php
function some_post_action( $post_object ) {
// your function here, use $post_object->ID to access post id
}
add_action( 'the_post', 'some_post_action' );
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With