Created
August 22, 2018 17:07
-
-
Save dougblackjr/0d7bc193a07971a40dcf1d6f3bad3620 to your computer and use it in GitHub Desktop.
Mass select authors by name in Wordpress import
This file contains hidden or 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
var a = $('ol#authors li strong') | |
a.each(function(index, el) { | |
let b = $(el).text().split(' (')[0] | |
let c = $(el).closest('li') | |
let d = $(c[0]).find('div select option:contains("' + b + '")').val(); | |
$(c[0]).find('div select').val(d) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OR, add them as new values: