Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    foreach( $i = 2; $i <= 10; $i++ ) {

    What are you TRYING to do there?

    Thread Starter virtualgeorge

    (@virtualgeorge)

    That was supposed to process 10 subsites at a time. We can process all subsites but I have 100+ subsites, so it may be a load on the server?

    Changed the foreach to for and it got rid of the error.

    Still doesn’t seem to making the changes to by DB though…

    This is what I have now:
    https://gist.github.com/bappi-d-great/f4d6e4de373b010ce294

    In line no 8 you need to give your super admin ID:

    $super_admin_id = 1;

    And in line 11, you need to change this line every time you refresh the admin page, like:

    foreach( $i = 2; $i <= 10; $i++ ) {
    .
    .
    .
    foreach( $i =11; $i <= 20; $i++ ) {
    .
    .
    .
    foreach( $i = 21; $i <= 30; $i++ ) {

    And that is supposed to update the db ??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    *ponder*

    So… I’m assuming you’re updating all posts so that user #4 is replaced with user #1?

    Why not just do it directly in SQL?

    Thread Starter virtualgeorge

    (@virtualgeorge)

    A lot of the posts had the author changed so instead of the author showing as the site owner/admin it was showing me the superadmin as author.

    I was using the wpthreebroadcast plugin to update pages and did something wrong so it change all my authors in all sites to the same superadmin.

    So I was using the above method because I have a membership at wpmudev so was trying to get a “free” fix. I don’t know how to write the queries for sql but paid someone to do it for me so its sorted now. Ran the script and it updated a few thousand posts in less than a minute, money well spent ??

    I will be happy to share my script if anyone needs it. I guess not many people would have a need for something like that.

    thx!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error in plugin to change post author’ is closed to new replies.