This is how we did it
add_action('admin_head-media-upload-popup','wmg_add_my_media_button');
function wmg_add_my_media_button(){
$args = array(
'numberposts' => -1,
'orderby' => 'title',
'order' => 'ASC',
'post_type' => array('post','page'),
'post_status' => 'publish' );
$posts_array = get_posts( $args );
if($_GET['tab']=='library'){
add_filter('pre_get_posts','wmg_my_search_filter');
function wmg_my_search_filter($wp_query) {
$wp_query->query_vars['post_parent'] = $_GET['filter_post'];
return $wp_query;
}
}
?>
<script type="text/javascript" >
jQuery(document).ready(function(){
jQuery('select[name=m]').after( "<select name='filter_post' style='width: 93px;'><option value='' selected='selected'>-??? ????-</option><?php foreach($posts_array as $one_post){
echo "<option value=".$one_post->ID.">".addslashes($one_post->post_title)."</option>";
}?></select>");
});
</script>
<?php
}
?>
<style>
#media-upload .tablenav .tablenav-pages{
width: 190px;
}
</style>