WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] Primary author issue (18 posts)

  1. bjorn2404
    Member
    Posted 1 year ago #

    I'm having an issue that relates to the primary author of a custom post type. I'm creating a new post, finding the author that should be assigned, removing my name (that's automatically added) but the primary author is still set to my account after I publish. If I use the_author() or the_author_meta() the data that's returned is my account even though I've removed it. If I use the coauthors() function it displays the correct author but I need to pull in some other information based on the author ID and there will only be 1 author for this custom post type.

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. crowinck
    Member
    Posted 1 year ago #

    I am having the same issue, not only with custom post types but also regular posts. I believe it started when I last updated the plugin. I'm going to have to roll back to an older version until this issue is fixed.

  3. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    I don't recommend rolling back, and won't be able to support that. In order to use Co-Authors Plus fully, you'll need to use our template tags.

    Using get_coauthors() gives you all of the information that's available in the standard WP User object.

  4. crowinck
    Member
    Posted 1 year ago #

    It's unrealistic to expect every other plugin we are using to use your special functions rather than the WordPress ones. Other plugins and features that aren't hooked into your plugin should be able to fall back on working with the main author. By preventing users from changing who is the main author for everything other than your plugin, you're not playing nice with everyone else.

    No one ever recommends rolling back, but it's not any better to hack my other plugins to use your functions.

  5. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    It's unrealistic to expect every other plugin we are using to use your special functions rather than the WordPress ones.

    Sorry for the confusion. The point of Co-Authors Plus is to allow you to assign multiple bylines to an article. WordPress doesn't have native support for multiple bylines — thus the requirement of adding the template tags.

    If you want it to work well with other plugins, you or the plugin author will need to add support for Co-Authors Plus. There's not much I can do because, again, core WordPress doesn't support multiple bylines. There's no standard paradigm to follow.

    Often, the easiest thing to do (as I have done with my other plugins) is to add a filter to the plugin in question where you can modify the output of the post author. Then, in your theme or an mu plugin, you can filter that output to return Co-Authors Plus instead.

    Co-Authors Plus does store the first author on any post type as 'post_author' so at least the first byline should persist if the plugin is deactivated.

    Hope this helps clarify.

  6. crowinck
    Member
    Posted 1 year ago #

    Thanks for the clarification. Let me also clarify.

    What we're saying is that on our sites, the storing of the first author as the WP 'post_author' is no longer working.

    If user A creates a blog post, and then tries to change the first author to user B, (so user A's name is no longer associated with the post in any way), all of the WordPress functions will still bring up user A, not user B.

    We don't expect the WP functions to bring up multiple authors, we just need them to bring up the right first author.

    I thought you were saying this was intentional. It sounds like you just misunderstood us.

  7. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    If user A creates a blog post, and then tries to change the first author to user B, (so user A's name is no longer associated with the post in any way), all of the WordPress functions will still bring up user A, not user B.

    Odd. I have a hunch why that may be the case though. Do your users have different user_logins than user_nicenames?

  8. crowinck
    Member
    Posted 1 year ago #

    It looks like all the usernames in question have spaces, so yes, I believe they would. (I haven't actually looked in the database or anything, let me know if you need me to confirm). The site is also a multisite install, in case that makes a difference.

    This problem started with Co-Authors Plus 3.0.

    Thanks for looking at it!

  9. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Ah, it's probably this issue. I'll try to test and merge to the development version tomorrow (which you can use until there's a new release out.

  10. bjorn2404
    Member
    Posted 1 year ago #

    Yep, same situation with usernames and nicenames for me.

  11. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Can you guys try installing the development version to see if that fixes it for you?

  12. crowinck
    Member
    Posted 1 year ago #

    Sorry, the bug is still there.

  13. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    I'm having a heck of a time trying to reproduce this with the dev version of the plugin.

    Here's what I'm doing:

    1. Created a new user with user_login "Daniel Bachhuber" and user_nicename "daniel-bachhuber"
    2. Created a new "Event" post and assigned my normal "daniel" user to the post. The post_author value in the database is 1
    3. Assigned the "Event" post to my new user with user_login "Daniel Bachhuber". The post_author value in the database changed to 8

    Can you give me steps to take to reproduce reliably?

  14. psbook
    Member
    Posted 1 year ago #

    This seems to be working for us again now. Thanks, Daniel.

  15. bjorn2404
    Member
    Posted 1 year ago #

    The development version seems to have fixed the issue for me too. Thanks

  16. crowinck
    Member
    Posted 1 year ago #

    Since it was working for other people I tried it again, in case I made a mistake and uploaded the wrong files or something. It's also working for me now.

    Sorry for the mistake, thanks a lot for following up and fixing this.

  17. bjorn2404
    Member
    Posted 1 year ago #

    crowinck, did you do anything besides re-uploading? I have it working fine in a staging environment but can't seem to get it working on the live site.

  18. crowinck
    Member
    Posted 1 year ago #

    I was actually using the dev version posted on WordPress.org rather than the one on github. When I have staging vs live issues it's always because of caching. Maybe the old author is being cached somewhere?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic