Eliminate some of our last remaining create_function() instances
* Moved some into private function callbacks * Eliminated some that weren't necessary anymore props obenland, markjaquith, nacin. fixes #14424 Built from https://develop.svn.wordpress.org/trunk@27373 git-svn-id: http://core.svn.wordpress.org/trunk@27222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -934,21 +934,13 @@ function wp_edit_attachments_query( $q = false ) {
|
||||
unset($q['post_mime_type']);
|
||||
|
||||
if ( isset($q['detached']) )
|
||||
add_filter('posts_where', '_edit_attachments_query_helper');
|
||||
$q['post_parent'] = 0;
|
||||
|
||||
wp( $q );
|
||||
|
||||
if ( isset($q['detached']) )
|
||||
remove_filter('posts_where', '_edit_attachments_query_helper');
|
||||
|
||||
return array($post_mime_types, $avail_post_mime_types);
|
||||
}
|
||||
|
||||
function _edit_attachments_query_helper($where) {
|
||||
global $wpdb;
|
||||
return $where .= " AND {$wpdb->posts}.post_parent < 1";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of classes to be used by a metabox
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user