From 64f01ba089410db60736a180040abe60b40228fc Mon Sep 17 00:00:00 2001 From: Miguel Estrada Date: Wed, 9 Aug 2017 15:58:33 -0700 Subject: [PATCH] excluding CMB2s from post-new --- includes/show-on-support.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/show-on-support.php b/includes/show-on-support.php index 96495fa..8bc6b6a 100644 --- a/includes/show-on-support.php +++ b/includes/show-on-support.php @@ -71,4 +71,12 @@ function metabox_exclude_on_slug( $display, $meta_box ) { } } -?> + // for excluding CMB2s from post-new + function cmb2_exclude_from_new( $display, $meta_box ) { + if ( !isset($_GET['post']) ) { + return; + } + + return $display; + } + add_filter( 'cmb2_show_on', 'cmb2_exclude_from_new', 10, 2 );