Created
June 4, 2012 20:33
-
-
Save webercoder/2870698 to your computer and use it in GitHub Desktop.
Auto-select authors for posts during WordPress import. They must already be assigned to the project. Enable jQuery in a plugin or functions.php, and paste this in the browser console.
Thanks for this, but it didn't work for me as the author list now includes the Author login. So I modified it a bit and this worked for me:
jQuery('#authors li').each(function(key, value) { var name = jQuery(this).children('strong').first().html(); jQuery(this).find('select').first().children('option').each(function(){ if (jQuery(this).html() === name) { jQuery(this).attr('selected', 'selected'); } }); });
I didn't need to include jQuery as it is already included in WP-Admin. So all that is needed is to paste it into your console and hit enter.
This is confirmed working as of Nov 2021 👌
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this, but it didn't work for me as the author list now includes the Author login.
So I modified it a bit and this worked for me:
I didn't need to include jQuery as it is already included in WP-Admin. So all that is needed is to paste it into your console and hit enter.