Created
October 27, 2014 11:49
-
-
Save Nessworthy/6f4dbc1a4303189acf2f to your computer and use it in GitHub Desktop.
Check all WordPress Media Items not attached to a post/page.
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
/** | |
* Must be viewing the media library of a WP install. | |
* Media library must be in list view. | |
* Will highlight checked items in yellow. PLEASE CHECK TO MAKE SURE THAT THOSE ARE THE ONES YOU WANT. | |
*/ | |
var $ = jQuery; | |
$('#the-list') | |
.children('tr') | |
.filter(function(){ | |
var d = $(this).children().filter(':nth-child(5)'); | |
if(d.text().match(/Unattached/)) { | |
return true; | |
} else { | |
return false; | |
} | |
}) | |
.css('background-color', 'yellow') | |
.find('input[type=checkbox]') | |
.prop('checked', true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment