How to filter Categories shown in Gutenberg?
-
Hi, I’d like to either remove or disable some category checkboxes and I’m not sure of the best way to do this with gutenberg REST API (new to the REST api). These are the options I’ve considered so far:
1. PHP: rest_prepare_category filter, however the json endpoint for categories used by gutenberg seems hardcoded with context = view and I only want this with context = edit
2. Js: I know I can use wp.data.select(‘core’).getEntityRecords(‘taxonomy’, ‘category’, {exclude: [16,17]} ) to get the data I want but have no idea how to pass this to the HierarchicalTermSelector or possibly use in the wp.hooks editor.PostTaxonomyType filter?
I’m struggling with the documentation on this- any advice would be very gratefully recieved!
- The topic ‘How to filter Categories shown in Gutenberg?’ is closed to new replies.