Automattic / Automattic/jetpack

JSON API: Non public Post Types are now visible in the WordPress.com UI

Open
#6,079 2 comments 0 reactions 2 assignees Assigned to @mtias View on GitHub
[Feature] WPCOM API [Pri] Normal [Status] Stale Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

1. Start from a Jetpack site using non public Post Types. 2 examples are revisions or feedback, from Jetpack's Contact Form module.
2. If you run Jetpack 4.4.2, WordPress.com looks like this:

![screen shot 2017-01-12 at 13 25 43](https://cloud.githubusercontent.com/assets/426388/21889852/3ea75b0a-d8cb-11e6-82c7-08df5f4ccafc.png)

Only public post types are displayed, as expected. When querying the API, I get only 3 post types:

![screen shot 2017-01-12 at 13 30 33](https://cloud.githubusercontent.com/assets/426388/21889868/5727728c-d8cb-11e6-99cb-502a92ecaec4.png)

3. As soon as I apply #5487, more post types appear on WordPress.com:

![screen shot 2017-01-12 at 13 31 57](https://cloud.githubusercontent.com/assets/426388/21889909/85f46caa-d8cb-11e6-9362-391f0b3df869.png)

![screen shot 2017-01-12 at 13 32 13](https://cloud.githubusercontent.com/assets/426388/21889914/8c6490e2-d8cb-11e6-97c8-cdd0c7801371.png)

The Post Types are not returned publicly though, so that's a good thing:

![screen shot 2017-01-12 at 13 32 44](https://cloud.githubusercontent.com/assets/426388/21889941/ac2d4630-d8cb-11e6-9f7f-4d8bda2fce9d.png)

I'm just not sure they should be displayed in the WordPress.com UI, since they're not meant to be edited or added through there.

Let's take the example of the Feedback Post Type; it is registered here:
https://github.com/Automattic/jetpack/blob/branch-4.5/modules/contact-form/grunion-contact-form.php#L122-L153

Although `show_in_rest` and `show_ui ` return `true`, `show_in_admin_bar` and `public` are set to `false`. Maybe we should take this into account on our end?

cc @aduth @lezama @mtias, since you worked on the original PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.