You can use the remove_action()
function, like this:
1 2 | remove_action('publish_post', 'old_action'); add_action('publish_post', 'new_action'); |
It’s important to note that if the old_action was added with a priority parameter, you must add that to the remove_action
call, otherwise it will fail to remove it. There are other implications if the old_action
was added within a class.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.