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_locked_dialog action
This hook fires inside the post locked dialog before the buttons are displayed. It can be quite useful when you need to perform some actions before the post lock dialog is shown to the user.
Description
This action hook fires inside the post locked dialog before the buttons are displayed. It consists of two parameters: the first is $post, which contains the post object to be used, and the second is $user, which contains the user object to be used. It’s used by the _admin_notice_post_locked() hook, which outputs the HTML.
Parameters
- $post: (WP_Post) Post object.
- $user: (WP_User) The user with the lock for the post.
Live Examples
Running the Action
To run the hook, copy the example below.
// run the action do_action( 'weplugins_post_locked_dialog', $post, $user);
Adding a Hook Callback
The following example is for adding a hook callback.
// define the post_locked_dialog callback function weplugins_action_post_lock_lost_dialog( $post, $user) { // make action magic happen here... }; // add the action add_action( 'weplugins_post_locked_dialog', 'weplugins_action_post_lock_lost_dialog', 10, 2 );
Removing a Hook Callback
To remove a hook callback, use the example below.
// remove the action remove_action( 'weplugins_post_locked_dialog', 'weplugins_action_post_lock_lost_dialog', 10, 2 );
Contact Us
Need customization or have any questions? 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.