post_stuck action
Fires once a post has been added to the sticky list.
do_action( 'post_stuck', int $post_id )
Description
This is action hook , whenever its fires after a post has been added to sticky list.
Its consists of one parameter, $post_id ,which is belongs to post thae was stuck.
Parameters
- $post_id : (int) ID of the post that was stuck.
Live Example
To run the hook, copy the example below.
do_action( 'post_stuck', int $post_id )
The following example is for adding a hook callback.
add_action( 'post_stuck', 'wp_post_stuck_action' ); /** * Function for `post_stuck` action-hook. * * @param int $post_id ID of the post that was stuck. * * @return void */ function wp_post_stuck_action( $post_id ){ // action... }
To remove a hook callback, use the example below.
// remove the action remove_action( 'post_stuck', 'wp_post_stuck_action', 10, 1 );