Last Updated: February 25, 2016
·
619
· styledev

Quick Select Authors during WP Import

jQuery('#authors li').each(function(){
  var strong = jQuery(this).find('strong').html(),
  strong_end = strong.indexOf(' ('),
  name = strong.substring(0,strong_end),
  select_field = jQuery(this).find('select');
select_field.find("option:contains('"+name+"')").prop("selected","selected");
})

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

WordPress sites collect scripts from themes, plugins, and tag managers. A compromised plugin update can add a skimmer to every page without a change in your own templates.

Security insights from Cside