WordPress.org

Ready to get started?Download WordPress

Forums

RSS Importer
Adding authors - solution (1 post)

  1. ollybenson
    Member
    Posted 1 year ago #

    Hi,

    This question has been asked before but I've got a solution.

    Open the rss-importer.php and find the line that says

    $post_author = 1

    And replace with this code:

    preg_match('|<dc:creator>(.*?)</dc:creator>|is', $post, $get_post_author);
    				$post_author_name = sanitize_user($wpdb->escape( html_entity_decode( trim( $get_post_author[1] ) ) ));
    			$post_author = username_exists( $post_author_name );
    			if (!$post_author) {
    					$random_password = wp_generate_password( $length=12, $include_standard_special_chars=false );
    					$post_author = wp_create_user( $post_author_name, $random_password, $post_author_name."@xxxxxxx.com");
    					}

    It'll create a new user for each distinct username passed, with a fake email address.

    http://wordpress.org/extend/plugins/rss-importer/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic