-
-
Save webercoder/2870698 to your computer and use it in GitHub Desktop.
Awesome work! Thank you!!
Incredible that after 6 years we still have to rely on this.
This is an essential feature for large backups.
Yet useless emoji and vanity features get developed rapidly for the joy of none and the bloat of the core.
best snippet ever! Thanks a million
Wow. Incredible. Thank you!
Give this man a cookie
Seven years later, still needed and phreaking awesome.
There is a bug, I think. The macro doesn't like parenthesis () in names. But even so it saved me half a day's work.
That's great piece of code.
You are the number one!
Magic 😱 Works great, thanks!
Still existing
Can anyone expound on this for me? I'm not sure how to make this code work on my site. I've tried saving as a js file and including in functions.php but it's not working for me. Thanks anyone! (WordPress 5.5.1. Attempting to import custom post type with multiple authors)
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.
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 👌
This is actually pretty clever. Thanks.