• Resolved tedinoz

    (@tedinoz)


    Hi

    I want to assign user posts to guest authors (and BTW, then I’ll delete the users) – I’ll use the wp-cli subcommands (once I learn how to use it <grin>!!). “create_guest_authors” is easy because there are no variables AND it does the entire list of users in one pass. “assign_user_to_coauthor” doesn’t seem so straightforward.

    2 questions:
    1: I’m confused by the data values to use. The code says “$args, $assoc_args”. As far as I can see $args is never referenced (or at least not at this point of development??), which leaves “$assoc_args”. “user_login” seems OK/logical, but what field is used for the value of ‘co-author’.

    2: Can one do this in bulk? Since “$assoc_args” is an array, would (unique) multiple pairs of user/co-authors result in assignment of posts for all of those pairs; or is this a one-at-a-time process.

    Ted

    https://www.ads-software.com/extend/plugins/co-authors-plus/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Daniel Bachhuber

    (@danielbachhuber)

    If you run:

    wp co-authors-plus create-guest-authors

    on the command line in the root directory of your WordPress install, it will automagically create guest authors for each of your users.

    You should be able to then just delete the users without having to run additional commands.

    It’s always worthwhile to make a backup before doing bulk transformations like this ??

    Vajaah

    (@vajaah)

    I’ve used the commands packaged for wp-cli and LOVE THEM. However, I’m finding that in order for the posts count to be updated in Admin > Guest Authors I need to update the posts individually. This install has 20,000 posts. I haven’t deleted the users yet, is that necessary? Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Values – `assign_user_to_coauthor`’ is closed to new replies.