• Resolved smunk

    (@smunk)


    Hi, I have some code to set the author for a post. It works fine when your plugin is not installed or activated, but doesnt work when your plugin is active.

    The code is:

    $arg = array('ID' => $post->ID,'post_author' => $id,);
    wp_update_post( $arg );

    Is there a way to set or change the author(s) of a post, from within PHP, that works when your plugin is active?

    Thank you.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add/change author from PHP’ is closed to new replies.