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

post_author not updated properly if assigning a new WP user #903

Open
dkoo opened this issue Dec 13, 2022 · 3 comments · May be fixed by #988
Open

post_author not updated properly if assigning a new WP user #903

dkoo opened this issue Dec 13, 2022 · 3 comments · May be fixed by #988
Milestone

Comments

@dkoo
Copy link

dkoo commented Dec 13, 2022

If updating a post's author and assigning a WP user (not a CAP guest author), the post_author field isn't updated even though the author taxonomy term is updated. Because the term is updated properly, the post will render with the correct author byline, but the post will not appear in any WP queries targeting the post_author ID or name. Verified in v3.5.6.

To replicate:

  1. Publish a post assigned to the site's default author.
  2. Using the CAP sidebar UI, add another WP user (not guest author) and remove the original author. Update the post.
  3. View the post and observe that the new WP user is shown as the byline.
  4. However, using WP CLI, get the post ($ wp post get <ID>) and observe that the post_author field still shows the default author's ID, not the second WP user's.
@oscarssanchez
Copy link
Contributor

I couldn't reproduce this locally. For me it is updating the post_author field with the correct ID as long as the author exists as a WP User.

@dkoo
Copy link
Author

dkoo commented Jan 18, 2023

I'm still able to replicate locally and on other staging sites. On some sites I had to repeat step 2 with another WP user before the post_author field got "stuck", but it's easily reproducible.

@eddiesshop eddiesshop linked a pull request Aug 26, 2023 that will close this issue
@GaryJones GaryJones added this to the 3.5.16 milestone Sep 17, 2023
@GaryJones
Copy link
Contributor

I've been able to replicate this. So far, the fix in #988 seems to be working.

@GaryJones GaryJones modified the milestones: 3.6.1, 3.6.2 Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants