Maybe this line:
$user_id = wp_insert_user( $user_data );
in the get_author_mapping()
function of the plugin is returning an error and therefore defaulting (in the following lines) to admin?
If that’s the case, then this “insert user” call should be returning the existing user, or maybe a retry on this call with the author’s ‘user_pass’ field blanked out since it is randomly generated each time and will never match an existing user?
Just throwing something out there. i’ll add more debug lines to the plugin tonight and try to see where it is failing.
or a problem with the import file having an older user id and the new wordpress blog having already given that user a new id?
Are you using the “or assign posts to an existing user” dropdown on the “Assign Authors” page for the 2nd, 3rd, … import(s) to map the users to those imported by the first file?
no, i have 470 users… would i have to do that in order to get this result?
that might be a nice “fill all” checkbox…
I think i may be able to go back using firebug and auto-select all of those if that is necessary… but is that the best way?
On that “Assign Authors” page, option 1 is “import this username” suggests to me that i’m importing that same user… it’s a little confusing
Is it possible to get something i could throw in the author_select()
function of the plugin as a temp fix to select the “or assign posts to…” option and have its selection match the $author['author_login']
or $author['author_display_name']
name (whichever is needed… mine are the same)?
Here’s a hack solution that fit my need. With almost 500 users i couldn’t select all of these by hand.
I wrote it up on my blog so i could put better description in it
–REMOVED– I fixed the last comment so i removed this comment.
Here’s the summary…
1) Get jQueryify here and add the bookmarklet per the instructions.
2) When you get to the “assign authors” page, right-click on the browser page and select “Inspect Element” (Chrome), or “Inspect with Firebug” in Firefox (install firebug if you haven’t already). In IE press F12 to start the Dev Tools.
3) Press the jQuerify bookmarklet button that you installed from step 1. This will turn on jQuery for the page.
4) Go to the console tab, enable the console if you need to, paste this code in and press RUN:
jQuery.noConflict(); //Disable jQuery $ just incase.
jQuery(‘#authors li’).each(function() {
// Get the author login text
var username = jQuery(this).find(‘strong’).html();
var author_login = jQuery.trim((username.split(‘(‘))[0]);
//Figure out which option this author is in the drop down.
var selectOptionval = -1;
jQuery(this).find(‘select option’).each(function(){
if (jQuery(this).html() === author_login) {
selectOptionval = jQuery(this).val();
return false;//quit .each() early.
}
});
// Set the combo box to this author’s option key.
jQuery(this).find(‘select’).val(selectOptionval);
// For test…
//console.log(author_login + “: ” + selectOptionval);
});