diff --git a/src/wp-includes/js/media-models.js b/src/wp-includes/js/media-models.js index ac7ee938d6..cba928d9c2 100644 --- a/src/wp-includes/js/media-models.js +++ b/src/wp-includes/js/media-models.js @@ -1164,7 +1164,9 @@ window.wp = window.wp || {}; 'perPage': 'posts_per_page', 'menuOrder': 'menu_order', 'uploadedTo': 'post_parent', - 'status': 'post_status' + 'status': 'post_status', + 'include': 'post__in', + 'exclude': 'post__not_in' }, /** * @static @@ -1211,6 +1213,12 @@ window.wp = window.wp || {}; props.orderby = defaults.orderby; } + _.each( [ 'include', 'exclude' ], function( prop ) { + if ( props[ prop ] && ! _.isArray( props[ prop ] ) ) { + props[ prop ] = [ props[ prop ] ]; + } + } ); + // Generate the query `args` object. // Correct any differing property names. _.each( props, function( value, prop ) {