您可以使用“save_post“胡克,看起来像这样。
add_action( \'save_post\', \'populate_empty_place\' );
function populate_empty_place( $post_id ) {
//verify post is not a revision
if ( !wp_is_post_revision( $post_id ) && get_post_type($post_id) == \'report\') {
// Check for empty place
// And popluate with your own value
}
}