This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
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 );
Explore the latest in WordPress
Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.