Closed paaljoachim closed 3 years ago
Btw adding a multi select drop down would make it possible to for instance using the above example selecting Posts and Pages then have drop downs for Posts and Pages show up. Then select multiple posts and pages.
I made this issue some time ago: Using multi select in a drop down? https://github.com/WordPress/gutenberg/issues/1044
This is great, thanks @paaljoachim. I recently started using React Select in the plugin for multi-select drop downs, and will definitely be using it in the Location controls since there is no native Gutenberg component with similar functionality. There is also an Async option where you can load options asynchronously, which might be the best solution, especially for sites with hundreds of pages and post types. Going to start digging into this after I get version 1.8 out the door next week.
I would suggest adding a PR to add the component into Gutenberg, as others will very likely have some good use out of it as well.
Example. Testing the plugin: https://wordpress.org/plugins/custom-layouts/
It uses a multi select which can be seen here:
https://user-images.githubusercontent.com/5323259/114298893-d8fc3780-9ab8-11eb-8d69-e80c63f7992d.mp4
One very interesting issue: Query Block - more advanced / multi select query options https://github.com/WordPress/gutenberg/issues/30706
Closing this issue. Location functionality has been implemented in Block Visibility Pro.
Hey Nick
Here is an example from the plugin: https://wordpress.org/plugins/post-type-archive-mapping/
https://user-images.githubusercontent.com/5323259/114249267-6a28bc80-999a-11eb-9129-57eda334a644.mp4
Query: Post Type -> Taxonomy -> Terms