Created
February 20, 2018 07:56
-
-
Save alokstha1/1d8a76dccac6b0db9bccf32de0a3b690 to your computer and use it in GitHub Desktop.
Save_post conditions
This file contains hidden or 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
<?php | |
add_action( 'save_post', 'cpm_resume_manager_save_resume', 10, 2 ); | |
function cpm_resume_manager_save_resume($post_id, $post) { | |
if ( empty( $post_id ) || empty( $post ) || empty( $_POST ) ) return; | |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; | |
if ( is_int( wp_is_post_revision( $post ) ) ) return; | |
if ( is_int( wp_is_post_autosave( $post ) ) ) return; | |
if ( $post->post_type != 'resume' ) return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment