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

westonruter
Copy link
Member

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 the Bug Something isn't working label Sep 17, 2018
@westonruter westonruter added this to the v1.0 milestone Sep 17, 2018
@westonruter westonruter requested a review from amedina September 17, 2018 18:10
Copy link
Member

@amedina amedina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it!

@westonruter westonruter merged commit 239c105 into develop Sep 17, 2018
@westonruter westonruter deleted the fix/custom-post-type-support branch September 17, 2018 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants