Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Featured Image – Add Display Settings

Add custom field to the “Featured Image” meta box.

function add_featured_image_display_settings( $content, $post_id ) {
	$field_id    = 'show_featured_image';
	$field_value = esc_attr( get_post_meta( $post_id, $field_id, true ) );
	$field_text  = esc_html__( 'Show image.', 'generatewp' );
	$field_state = checked( $field_value, 1, false);
	
	$field_label = sprintf(
	    '<p><label for="%1$s"><input type="checkbox" name="%1$s" id="%1$s" value="%2$s" %3$s> %4$s</label></p>',
	    $field_id, $field_value, $field_state, $field_text
	);
	
	return $content .= $field_label;
}
add_filter( 'admin_post_thumbnail_html', 'add_featured_image_display_settings', 10, 2 );