I've made a video custom post type and on the edit page I've placed a meta box where I display a shortcode associated to the post, to make it easier for the user.
However, I wish the shortcode and/or the box to be visible on the edit post page only and not on the new post page, where it's not yet relevant - what am I looking for here? I have this nagging feeling I've done this/something similar before but just can't think of what to search for.
ETA: This is what I did with the help I got below, might be useful to someone else too:
add_action( 'add_meta_boxes', 'my_video_add_custom_box' );
function my_video_add_custom_box() {
if (get_post_status( $post->ID ) != 'auto-draft') {
add_meta_box(
'my_video_shortcode_custom_box',
__( 'Shortcode', 'my_video' ),
'my_video_shortcode_custom_box',
'my_video', 'side', 'default'
);
}
}
Works like a charm, thanks!