Created
December 20, 2018 05:56
-
-
Save BhargavBhandari90/cc6943eda51fbffd458d239852d144b6 to your computer and use it in GitHub Desktop.
Assign Users while importing data in WP importer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$('#authors li').each(function(key, value) { | |
var name = $(this).children('strong').first().html(); | |
var re = /\s\([^\)]+\)/gi; | |
name = name.replace(re, ''); | |
$(this).find('select').first().children('option').each(function(){ | |
if ($(this).html() == name) { | |
console.log('Comparing ' + $(this).html() + ' to ' + name + ".\n"); | |
$(this).attr('selected', 'selected'); | |
} | |
}); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment