Skip to content
This repository has been archived by the owner. It is now read-only.

Only link `author` when there's a valid author #1203

Merged
merged 3 commits into from May 8, 2015

Conversation

@danielbachhuber
Copy link
Member

commented May 7, 2015

Fixes #1192

@danielbachhuber danielbachhuber added this to the 2.0 Beta 2 milestone May 7, 2015
@danielbachhuber

This comment has been minimized.

Copy link
Member Author

commented May 7, 2015

@WP-API/amigos #reviewmerge

@@ -1074,7 +1074,8 @@ protected function prepare_links( $post ) {
),
);
if ( in_array( $post->post_type, array( 'post', 'page' ) ) || post_type_supports( $post->post_type, 'author' ) ) {
if ( ( in_array( $post->post_type, array( 'post', 'page' ) ) || post_type_supports( $post->post_type, 'author' ) )

This comment has been minimized.

Copy link
@joehoyle

joehoyle May 8, 2015

Contributor

Out of curiosity, why do we whitelist the post types here?

This comment has been minimized.

Copy link
@danielbachhuber

danielbachhuber May 8, 2015

Author Member

To force the data to always be present, even if the developer has removed post type supports.

Our posts and pages are fixed schemas. Except not, of course.

joehoyle added a commit that referenced this pull request May 8, 2015
Only link `author` when there's a valid author
@joehoyle joehoyle merged commit ac9a324 into develop May 8, 2015
2 checks passed
2 checks passed
Scrutinizer 1 updated code elements
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@joehoyle joehoyle deleted the 1192-no-zero-author-link branch May 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.