Sandeep Kumar Mishra
Sandeep Kumar Mishra writes about WordPress and Artificial Intelligence, offering tips and guides to help you master your website and stay updated with the latest tech trends.
“`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.
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);
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);
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.
“`
Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.