Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The “show_on” filter doesn’t work in attaching posts with CMB2 #45

Open
bassakirou opened this issue Jul 11, 2017 · 1 comment
Open

Comments

@bassakirou
Copy link

Hi,

I am very satisfied with CMB2. But the “show_on” filter doesn’t work in attaching posts with CMB2. It seems that it’s not included in your add-on.
How can I do to show attaching posts in specific page template ?

Best regards.

@pabamato
Copy link

pabamato commented May 17, 2018

Did you try with show_on_cb:

$feed_mb = new_cmb2_box( array(
	'id'           => 'prefix_my_id',
	'title'        => __( 'This is my title', 'cmb2' ),
	'object_types' => array( 'page' ), // Post type
	'context'      => 'normal',
	'priority'     => 'high',
	'show_names'   => false, // Show field names on the left
	'show_on_cb'   => 'cmb_only_show_for_my_page',
	// Or for OO 
	//'show_on_cb' 	 => array(__CLASS__, 'cmb_only_show_for_my_page'),
) ); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants