jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

JSON API: build interface allowing you to whitelist CPTs for the wpcom REST API

Open jeherve opened this issue 10 years ago • 6 comments

One can use the rest_api_allowed_post_types filter to whitelist a specific CPT, and thus manage it from WordPress.com: https://developer.jetpack.com/hooks/rest_api_allowed_post_types/

However, to be able to use that feature, you need to find the code snippet, and add to your theme's functions.php file or in a functionality plugin. What if we had an interface, in wp-admin, allowing you to whitelist any of the CPTs currently active on your site? It would help people discover another aspect of Calypso.

@rickybanister suggested adding this interface to Settings > Writing, when there are active CPTs.

Related Discussion: p6TEKc-Ey-p2

jeherve avatar Sep 07 '16 07:09 jeherve

This feels like it belongs somewhere along with the existing "Custom Content Types" UI, which looks like this right now:

screen shot 2016-10-05 at 3 42 34 pm

We could just list out the locally-registered custom post types (and taxonomies?) and allow the user to check a box next to them (or a toggle, or whatever) to whitelist them.

Love this idea.

beaulebens avatar Oct 05 '16 21:10 beaulebens

Since we're refactoring the Settings UI, can we move it to 4.6 where the rest of the Settings UI overhaul belongs?

zinigor avatar Nov 29 '16 19:11 zinigor

cc @aduth @lezama @mtias who worked on #5487 ^

jeherve avatar Dec 01 '16 14:12 jeherve

I think the setting change would be in addition to the other change, right? It seems we can improve the experience in some ways without having to add an option for CPT to appear.

mtias avatar Dec 01 '16 15:12 mtias

This would be cool for 4.6 with the settings UI

samhotchkiss avatar Dec 01 '16 16:12 samhotchkiss

Fixed in #5487

jeherve avatar Jan 12 '17 12:01 jeherve