Skip to content
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

Defer adding post type support until post types have been registered #1441

Merged
merged 1 commit into from Sep 17, 2018

Conversation

Projects
None yet
2 participants
@westonruter
Copy link
Member

commented Sep 17, 2018

Post types are supposed to be registered at the init action, normally at priority 10. For example Jetpack's Testimonial and Portfolio post types. However, the call to register amp post type support:

https://github.com/Automattic/amp-wp/blob/84c1ab11811d0bb056e61b04d157c2d54a435434/amp.php#L153

Happens at init priority 0:

https://github.com/Automattic/amp-wp/blob/84c1ab11811d0bb056e61b04d157c2d54a435434/amp.php#L127

This prevents custom post types from being included in the eligible post types for AMP support.

The fix is just to defer the post type support addition to a later priority in the init action.

@westonruter westonruter added this to the v1.0 milestone Sep 17, 2018

@westonruter westonruter requested a review from amedina Sep 17, 2018

@amedina
Copy link
Member

left a comment

Ship it!

@westonruter westonruter merged commit 239c105 into develop Sep 17, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the fix/custom-post-type-support branch Sep 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.