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.
“`html
This action hook fires after the Save Draft (or Save as Pending) and Preview (or Preview Changes) buttons in the Publish meta box. It’s a handy way to run custom functionality at a very specific point in the WordPress post editing process.
The hook consists of one parameter, $post, which refers to the current post object.
- $post: (WP_Post) WP_Post object for the current post.
Example 1: Running the Hook
To run the hook, simply use the following code snippet. It’s very straightforward!
// run the action do_action('weplugins_post_submitbox_minor_actions', $post);
Example 2: Adding a Hook Callback
If you need to add a custom function to this hook, use the example below. This way, you can make your custom magic happen right at the right moment.
// define the weplugins_post_submitbox_minor_actions callback function weplugins_action_post_submitbox_minor_actions($post) { // make action magic happen here... }; // add the action add_action('weplugins_post_submitbox_minor_actions', 'weplugins_action_post_submitbox_minor_actions', 10, 1);
Example 3: Removing a Hook Callback
Sometimes, you might want to remove a callback from this hook. Here’s how you can do that. It’s as simple as it gets!
// remove the action remove_action('weplugins_post_submitbox_minor_actions', 'weplugins_action_post_submitbox_minor_actions', 10, 1);
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.