Warning: in_array() expects parameter 2 to be array, null given in /home1/vfxdudec/public_html/wp-content/themes/vfxdude/library/functions/widgets.php on line 238

Warning: in_array() expects parameter 2 to be array, null given in /home1/vfxdudec/public_html/wp-content/themes/vfxdude/library/functions/widgets.php on line 243
Vfxdude – add updated custom field to a custom post type

Warning: in_array() expects parameter 2 to be array, null given in /home1/vfxdudec/public_html/wp-content/themes/vfxdude/page.php on line 2
function bf_add_updated_cf( $post_id ) {	
    if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || wp_is_post_revision($post_id)) return;
    if ( 'posttype' == $_POST['post_type'] ) {
        $post = get_post($post_id);
        update_post_meta($post_id, '_modified', $post->post_modified);
    }
}
add_action( 'save_post', 'bf_add_updated_cf' );