//メディア自分ののみ
add_action( "pre_get_posts", "set_ajax_media_query" );
function set_ajax_media_query( $wp_query ) {
global $current_user;
if( $wp_query ->query_vars['post_type'] != "attachment" ) {
return;
}
get_currentuserinfo();
if( $current_user->roles[0] == "administrator" ) {
return;
}
$wp_query->query_vars['author'] = $current_user->ID;
}