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

Search button does not load just custom post type posts #63

Open
aeboi80 opened this issue Nov 3, 2020 · 1 comment
Open

Search button does not load just custom post type posts #63

aeboi80 opened this issue Nov 3, 2020 · 1 comment

Comments

@aeboi80
Copy link

aeboi80 commented Nov 3, 2020

I have a custom post type called billco-products and I have registered an attached posts field

$product_properties->add_field( array(
	'name'    		=> __( 'Related Products', 'o2dcaframework' ),
	'desc'    		=> __( 'Drag products from the left column to the right column to relate them to this product.<br />You may rearrange the order of the products in the right column by dragging and dropping.', 'o2dcaframework' ),
	'id'      		=> $prefix . 'related_products',
	'type'    		=> 'custom_attached_posts',
	'column'  		=> true,
	'options' 		=> array(
		'show_thumbnails' 	=> true,
		'filter_boxes'    	=> true,
		'query_args'      	=> array(
			'posts_per_page' 	=> 10,
			'post_type'      	=> array('billco-products'),
		),
	),
) );

When you click the the search button it pulls up the modal but doesn't list any posts. If I alter the post_type args array to be

'post_type'      	=> array('billco-products','page'),

and then go back and click the search button, I am returned with a list of all pages as well as all of the billco-products posts.

I am not sure where the disconnect is here. Honestly it would be great to even just hide the search box since the filter box is available.

@tw2113
Copy link

tw2113 commented Nov 4, 2020

I guess my question is how big of a deal is this, in the event it's not necessarily a bug.

I'm getting lost the moment I'm hitting app.SearchView = window.Backbone.View.extend in our JS file, cause a types property is coming from that and I can't trace my way beyond that.

Regarding the search, you could probably add some quick styles to admin_head and hide with .cmb2-attached-posts-search-button class.

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