/*add_filter( ‘ajax_query_attachments_args’, ‘filterMediaLibrary’, 10, 1 );

function filterMediaLibrary($query = array()) {

$query[‘post_parent’] = $_POST[‘post_id’];

//$user = filter_input(INPUT_GET, ‘user’, FILTER_SANITIZE_STRING );

//$query[‘author’] = $user;

return $query;

}*/

 

 

/*function wpse156319_posts_where( $where, $query ) {

global $wpdb;

$where .= $wpdb->prepare( ‘ AND (‘ . $wpdb->posts . ‘.post_parent = %s OR ‘ . $wpdb->posts . ‘.post_author = %s)’, $_REQUEST[‘id’], $_REQUEST[‘user’] );

return $where;

}

 

 

function filterMediaLibrary($query = array()) {

add_filter( ‘posts_where’, ‘wpse156319_posts_where’, 10, 2 );

return $query;

}*/

Leave a Reply