Skip to content

Commit

Permalink
Add check for author in post data before submission (#15375)
Browse files Browse the repository at this point in the history
Previously, the submission code on the Post Edit page assumed that the
Post data from the REST API contained an author field. But this is not
the case for CPT's that do not include `author` in their `supports`
array. This commit only includes the author in the submission if it
exists.
  • Loading branch information
alexsanford authored and youknowriad committed May 7, 2019
1 parent 9c6e062 commit 5c87bce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/edit-post/src/store/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const effects = {
post.comment_status ? [ 'comment_status', post.comment_status ] : false,
post.ping_status ? [ 'ping_status', post.ping_status ] : false,
post.sticky ? [ 'sticky', post.sticky ] : false,
[ 'post_author', post.author ],
post.author ? [ 'post_author', post.author ] : false,
].filter( Boolean );

// We gather all the metaboxes locations data and the base form data
Expand Down

0 comments on commit 5c87bce

Please sign in to comment.