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_unstuck action
Fires once a post has been removed from the sticky list.
do_action( 'post_unstuck', int $post_id )
Description
This is an action hook, which fires once a post has been removed from the sticky list. By using this hook, a post can be removed from the sticky list. It consists of one parameter, which is the $post->ID.
Parameters
- $post_id: (int) ID of the post that was unstuck.
Live Examples
Example 1: Running the Action
To run the hook, copy the example below.
// run the action do_action( 'post_unstuck', $post_id );
Example 2: Adding a Hook Callback
The following example is for adding a hook callback.
// define the weplugins_post_types_to_delete_with_user callback function weplugins_filter_post_types_to_delete_with_user( $post_types_to_delete, $id ) { // make filter magic happen here... return $post_types_to_delete; }; // add the filter add_filter( 'post_types_to_delete_with_user', 'weplugins_filter_post_types_to_delete_with_user', 10, 2 );
Example 3: Removing a Hook Callback
To remove a hook callback, use the example below.
// remove the action remove_action( 'post_unstuck', 'weplugins_action_post_unstuck', 10, 1 );
If you need customization or have any questions, feel free to Contact Us.
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.