-
Notifications
You must be signed in to change notification settings - Fork 382
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
Allow Custom Post Types to be enabled via admin/customizer #798
Comments
As with #803, let's merge the analytics into a general AMP settings screen, and we can have it appear under the Settings parent admin menu. We'll start by adding it to the admin screen and then we'll in a later issue move it to the Customizer, along with analytics. |
Since the goal is to eventually move to Customizer anyway, let's not worry about #803 here. For the moment we can add a new “AMP > Settings” admin submenu page under the existing AMP menu item, and it can then be the default subitem appearing before Analytics. (Having a separate admin screen for Analytics still makes sense since @ThierryA points out that the fields are repeatable.) This AMP > Settings screen can then have the post type configurations and other settings we add prior to Customizer integration. When Customizer integration does happen, this AMP menu item can just redirect to the AMP panel in the Customizer. |
Acceptance criteria:
|
@ThierryA got a question about how this works. Using the following screenshot: http://d.pr/i/xrTNY6. A. If I checkmark “Bar” will I be forcing AMP to be enabled for this CPT? I'm a bit confused about how checking something off could cause different results. |
@jwold sorry, I actually made those parenthetical comments part of the registered post type labels themselves: This was just to help with testing to know that one of the post type is configured to be forced-on, and another with forced-off. Normally these parenthetical comments would not be presented. |
Ahh, thanks so much! I should have read the CPT in the sidebar to realize. So if a post type (such as bar) is configured forced-on, what happens if I do checkmark it and what happens if I don't? Same thing with the force-disabled option. |
An error message will be displayed after saving, indicating that your choice was not persisted, and why. |
AC verified, along with WP error messages re: invalid checking/unchecking |
[Edited] Refer to the latest acceptance criteria.
As noted in the readme:
This requires someone to write code for adding support. However, this ability to opt-in to post type support could instead be presented in the admin (or in the Customizer) so that the user doesn't have to write any code at all.
The list of post types could be presented with checkboxes for deciding whether or not AMP support should be enabled. The checkbox for generic posts would be shown with a checked checkbox that is also disabled since support is built-in and cannot be disabled. After that a checkbox for pages could be presented, once we have pages listed and enabled by default (once we have #176) but then perhaps allow the user to disable support by unchecking it if they don't want it. Then each of the other public post types could be listed, with the checkboxes by default unchecked. Any post types that have hard-coded post type support in the theme or plugin would be disabled and checked.
The text was updated successfully, but these errors were encountered: