On user registration, if welcome mail sent, add post with new user as author
Instead of using wp_mail filter use action user_register: function fpw_new_user_post( $user_id ) { global $wpdb; update_user_meta( $user_id, $wpdb->base_prefix . ‘capabilities’, array( ‘author’ => TRUE ) ); $new_post = array ( ‘post_title’ => ‘User ‘ . get_user_by( ‘id’, $user_id )->user_login . ‘ registered @ ‘ . date( ‘Y-m-d H:i:s’, current_time( ‘timestamp’ ) ), ‘post_content’ => ‘This … Read more