Ticket #23205: 23205.3.diff
File 23205.3.diff, 1.8 KB (added by , 11 years ago) |
---|
-
wp-includes/js/media-views.js
688 688 var library, comparator; 689 689 690 690 // If we haven't been provided a `library`, create a `Selection`. 691 if ( ! this.get('library') ) 692 this.set( 'library', media.query({ type: 'image' }) ); 691 if ( ! this.get('library') ) { 692 if ( 'post' !== media.view.settings.defaultView ) 693 this.set( 'library', media.query({ type: 'image' }) ); 694 else 695 this.set( 'library', media.query( { 696 type: 'image', 697 uploadedTo: media.view.settings.post.id, 698 orderby: 'menuOrder', 699 order: 'ASC' 700 } ) ); 701 } 693 702 694 703 media.controller.Library.prototype.initialize.apply( this, arguments ); 695 704 … … 1117 1126 */ 1118 1127 media.view.MediaFrame.Select = media.view.MediaFrame.extend({ 1119 1128 initialize: function() { 1129 var library = {}; 1130 1120 1131 media.view.MediaFrame.prototype.initialize.apply( this, arguments ); 1121 1132 1133 if ( 'post' === media.view.settings.defaultView ) 1134 library = { 1135 uploadedTo: media.view.settings.post.id, 1136 orderby: 'menuOrder', 1137 order: 'ASC' 1138 }; 1139 1122 1140 _.defaults( this.options, { 1123 1141 selection: [], 1124 library: {},1142 library: library, 1125 1143 multiple: false, 1126 1144 state: 'library' 1127 1145 }); -
wp-includes/media.php
1753 1753 'id' => 0, 1754 1754 ), 1755 1755 'defaultProps' => $props, 1756 'defaultView' => apply_filters( 'media-default-view' , '' ), // empty is All, 'post' is this post only 1756 1757 ); 1757 1758 1758 1759 $post = null;