• Anyone know of (or care to whip up) a plugin or hack that will let you edit a post’s author when there are multiple authors?
    Thanks,
    -Bob

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same issue here – I accidentally wrote a bunch of posts as “Admin” when I should have been logged in as myself – now I don’t know how to change them back – any ideas out there?
    Thanks
    Rob

    Thread Starter pixellated

    (@pixellated)

    Well, seeing as it’s been two weeks and nobody’s even responded with so much as a “feh” I decided to muddle my way through and add it in myself. This is a total hack, and isn’t pretty by WP standards, but it works.
    In /wp-admin/post.php, scroll down to case ‘edit’ and add the following after $post_title = addslashes($_POST[‘post_title’]);:
    $post_author = $_POST['post_author'];
    Scroll a little farther down to the UPDATE $tableposts query and add the following after post_status = ‘$post_status’,:
    post_author = '$post_author',
    Save and close.
    Open /wp-admin/edit-form-advanced.php and scroll down to the postpassworddiv fieldset, and add this in immediately following it:

    <fieldset id="postauthordiv">
    <legend><?php _e('Post Author') ?></legend>
    <div>
    <select name="post_author">
    <?php
    $authq = "select * from wp_users order by ID";
    $authr = mysql_query($authq) or die(mysql_error());
    while ($auth = mysql_fetch_array($authr)) {
    echo '<option value="' . $auth['ID'] . '">' . $auth['user_nickname'] . '</option>';
    }
    ?>
    </select>
    </div>
    </fieldset>

    Save and close.
    Done.

    Interesting — I just changed the author name in the database when i needed to, but that looks useful.

    Thanks! Very useful. Much easier than working in the database!
    Kaimi Wenger

    A quick follow-up question — right now, any time I edit a thread, it wants to reassign the author as site admin. Can I change that?

    Thread Starter pixellated

    (@pixellated)

    Hmm… I suppose you could modify the dropdown menu to default to a different user each time. You’d have to hard-code it in, though:

    <select name="post_author">
    <!-- hard-coded default -->
    <option value="X" selected="selected">Default User Name</option>
    <!-- end default -->
    <?php
    $authq = "select * from wp_users order by ID";
    $authr = mysql_query($authq) or die(mysql_error());
    while ($auth = mysql_fetch_array($authr)) {
    echo '<option value="' . $auth['ID'] . '">' . $auth['user_nickname'] . '</option>';
    }
    ?>
    </select>

    See if that helps.

    ive got the X-value:
    <option value="<?php the_Author_ID() ?>" selected="selected"><?php the_author() ?></option>

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Change Author hack/plugin?’ is closed to new replies.