• Hi,

    I am trying to add a co author from the front-end with following code

    <?php  if ( is_user_logged_in() ) {
    
        $update_creator = array(
                    'ID'          => get_the_ID(),
                    'post_author' => wp_get_current_user()
                );
    
        wp_update_post( $update_creator );
    
    } ?>

    I will eventually include this in a button and on press the author will be added to the co author list.

    Can you please tell me what I am doing wrong above?

    https://wordpress.org/plugins/co-authors-plus/

Viewing 1 replies (of 1 total)
  • Thread Starter cgarts

    (@cgarts)

    Hi,

    If the above is complicated I would also be happy to simply have the author widget in the frontend.

    If there is extra dev let me know and I will cover the hours.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Add Authors from frontend.’ is closed to new replies.