Last active
August 30, 2020 07:34
-
-
Save mohammadYousefiDev/7ef93c444660f3525442ddaec37706ee to your computer and use it in GitHub Desktop.
wordpress save_post_{custom_post_type} hook when save post and update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'save_post_{custom_post_type}', 'hook_callback' ); | |
public function hook_callback($post_id) | |
{ | |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) | |
return; | |
if( !empty($_POST) ) | |
{ | |
//your statements like save metaboxes or fire any hooks | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment