WP_Import::author_select PHP Method

author_select() public method

Display import options for an individual author. That is, either create a new user based on import info or map to an existing user
public author_select ( integer $n, array $author )
$n integer Index for each author in the form
$author array Author information, e.g. login, display name, email
        function author_select($n, $author)
        {
            _e('Import author:', 'wordpress-importer');
            echo ' <strong>' . esc_html($author['author_display_name']);
            if ($this->version != '1.0') {
                echo ' (' . esc_html($author['author_login']) . ')';
            }
            echo '</strong><br />';
            if ($this->version != '1.0') {
                echo '<div style="margin-left:18px">';
            }
            $create_users = $this->allow_create_users();
            if ($create_users) {
                if ($this->version != '1.0') {
                    _e('or create new user with login name:', 'wordpress-importer');
                    $value = '';
                } else {
                    _e('as a new user:', 'wordpress-importer');
                    $value = esc_attr(sanitize_user($author['author_login'], true));
                }
                echo ' <input type="text" name="user_new[' . $n . ']" value="' . $value . '" /><br />';
            }
            if (!$create_users && $this->version == '1.0') {
                _e('assign posts to an existing user:', 'wordpress-importer');
            } else {
                _e('or assign posts to an existing user:', 'wordpress-importer');
            }
            wp_dropdown_users(array('name' => "user_map[{$n}]", 'multi' => true, 'show_option_all' => __('- Select -', 'wordpress-importer')));
            echo '<input type="hidden" name="imported_authors[' . $n . ']" value="' . esc_attr($author['author_login']) . '" />';
            if ($this->version != '1.0') {
                echo '</div>';
            }
        }