diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
index 4f30007..9e1b8c5 100644
a
|
b
|
function wp_ajax_query_attachments() { |
2627 | 2627 | 'paged', |
2628 | 2628 | 'post_mime_type', |
2629 | 2629 | 'post_parent', |
| 2630 | 'author', |
2630 | 2631 | 'post__in', |
2631 | 2632 | 'post__not_in', |
2632 | 2633 | 'year', |
diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php
index 4b29ba6..f022cd3 100644
a
|
b
|
class WP_Media_List_Table extends WP_List_Table { |
130 | 130 | _x( 'Trash', 'attachment filter' ) |
131 | 131 | ); |
132 | 132 | } |
| 133 | |
| 134 | $type_links['mine'] = sprintf( |
| 135 | '<option value="mine"%s>%s</option>', |
| 136 | selected( 'mine' === $filter, true, false ), |
| 137 | __( 'Mine' ) |
| 138 | ); |
| 139 | |
133 | 140 | return $type_links; |
134 | 141 | } |
135 | 142 | |
diff --git a/src/wp-includes/js/media-models.js b/src/wp-includes/js/media-models.js
index 28caa15..bd194fc 100644
a
|
b
|
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ |
1121 | 1121 | // Only observe when a limited number of query args are set. There |
1122 | 1122 | // are no filters for other properties, so observing will result in |
1123 | 1123 | // false positives in those queries. |
1124 | | allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent' ]; |
| 1124 | allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent', 'author' ]; |
1125 | 1125 | if ( wp.Uploader && _( this.args ).chain().keys().difference( allowed ).isEmpty().value() ) { |
1126 | 1126 | this.observe( wp.Uploader.queue ); |
1127 | 1127 | } |
… |
… |
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ |
1238 | 1238 | * @readonly |
1239 | 1239 | */ |
1240 | 1240 | propmap: { |
1241 | | 'search': 's', |
1242 | | 'type': 'post_mime_type', |
1243 | | 'perPage': 'posts_per_page', |
1244 | | 'menuOrder': 'menu_order', |
1245 | | 'uploadedTo': 'post_parent', |
1246 | | 'status': 'post_status', |
1247 | | 'include': 'post__in', |
1248 | | 'exclude': 'post__not_in' |
| 1241 | 'search': 's', |
| 1242 | 'type': 'post_mime_type', |
| 1243 | 'perPage': 'posts_per_page', |
| 1244 | 'menuOrder': 'menu_order', |
| 1245 | 'uploadedTo': 'post_parent', |
| 1246 | 'status': 'post_status', |
| 1247 | 'include': 'post__in', |
| 1248 | 'exclude': 'post__not_in', |
| 1249 | 'author': 'author' |
1249 | 1250 | }, |
1250 | 1251 | /** |
1251 | 1252 | * Creates and returns an Attachments Query collection given the properties. |
… |
… |
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ |
1267 | 1268 | * @param {Object} [props.menu_order] |
1268 | 1269 | * @param {Object} [props.post_parent] |
1269 | 1270 | * @param {Object} [props.post_status] |
| 1271 | * @param {Object} [props.author] |
1270 | 1272 | * @param {Object} [options] |
1271 | 1273 | * |
1272 | 1274 | * @returns {wp.media.model.Query} A new Attachments Query collection. |
diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js
index 53f02cd..539fdc5 100644
a
|
b
|
Uploaded = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.Attac |
7261 | 7261 | all: { |
7262 | 7262 | text: text || l10n.allMediaItems, |
7263 | 7263 | props: { |
7264 | | uploadedTo: null, |
7265 | | orderby: 'date', |
7266 | | order: 'DESC' |
| 7264 | uploadedTo: null, |
| 7265 | orderby: 'date', |
| 7266 | order: 'DESC', |
| 7267 | author: null |
7267 | 7268 | }, |
7268 | 7269 | priority: 10 |
7269 | 7270 | }, |
… |
… |
Uploaded = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.Attac |
7272 | 7273 | text: l10n.uploadedToThisPost, |
7273 | 7274 | props: { |
7274 | 7275 | uploadedTo: wp.media.view.settings.post.id, |
7275 | | orderby: 'menuOrder', |
7276 | | order: 'ASC' |
| 7276 | orderby: 'menuOrder', |
| 7277 | order: 'ASC', |
| 7278 | author: null |
7277 | 7279 | }, |
7278 | 7280 | priority: 20 |
7279 | 7281 | }, |
… |
… |
Uploaded = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.Attac |
7282 | 7284 | text: l10n.unattached, |
7283 | 7285 | props: { |
7284 | 7286 | uploadedTo: 0, |
7285 | | orderby: 'menuOrder', |
7286 | | order: 'ASC' |
| 7287 | orderby: 'menuOrder', |
| 7288 | order: 'ASC', |
| 7289 | author: null |
| 7290 | }, |
| 7291 | priority: 50 |
| 7292 | }, |
| 7293 | |
| 7294 | mine: { |
| 7295 | text: l10n.mine, |
| 7296 | props: { |
| 7297 | orderby: 'date', |
| 7298 | order: 'DESC', |
| 7299 | author: parseInt( userSettings.uid ) |
7287 | 7300 | }, |
7288 | 7301 | priority: 50 |
7289 | 7302 | } |
… |
… |
All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.Attachment |
7320 | 7333 | filters[ key ] = { |
7321 | 7334 | text: text, |
7322 | 7335 | props: { |
7323 | | status: null, |
7324 | | type: key, |
7325 | | uploadedTo: null, |
7326 | | orderby: 'date', |
7327 | | order: 'DESC' |
| 7336 | status: null, |
| 7337 | type: key, |
| 7338 | uploadedTo: null, |
| 7339 | orderby: 'date', |
| 7340 | order: 'DESC', |
| 7341 | author: null |
7328 | 7342 | } |
7329 | 7343 | }; |
7330 | 7344 | }); |
… |
… |
All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.Attachment |
7332 | 7346 | filters.all = { |
7333 | 7347 | text: l10n.allMediaItems, |
7334 | 7348 | props: { |
7335 | | status: null, |
7336 | | type: null, |
7337 | | uploadedTo: null, |
7338 | | orderby: 'date', |
7339 | | order: 'DESC' |
| 7349 | status: null, |
| 7350 | type: null, |
| 7351 | uploadedTo: null, |
| 7352 | orderby: 'date', |
| 7353 | order: 'DESC', |
| 7354 | author: null |
7340 | 7355 | }, |
7341 | 7356 | priority: 10 |
7342 | 7357 | }; |
… |
… |
All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.Attachment |
7345 | 7360 | filters.uploaded = { |
7346 | 7361 | text: l10n.uploadedToThisPost, |
7347 | 7362 | props: { |
7348 | | status: null, |
7349 | | type: null, |
7350 | | uploadedTo: wp.media.view.settings.post.id, |
7351 | | orderby: 'menuOrder', |
7352 | | order: 'ASC' |
| 7363 | status: null, |
| 7364 | type: null, |
| 7365 | uploadedTo: wp.media.view.settings.post.id, |
| 7366 | orderby: 'menuOrder', |
| 7367 | order: 'ASC', |
| 7368 | author: null |
7353 | 7369 | }, |
7354 | 7370 | priority: 20 |
7355 | 7371 | }; |
… |
… |
All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.Attachment |
7358 | 7374 | filters.unattached = { |
7359 | 7375 | text: l10n.unattached, |
7360 | 7376 | props: { |
7361 | | status: null, |
7362 | | uploadedTo: 0, |
7363 | | type: null, |
7364 | | orderby: 'menuOrder', |
7365 | | order: 'ASC' |
| 7377 | status: null, |
| 7378 | uploadedTo: 0, |
| 7379 | type: null, |
| 7380 | orderby: 'menuOrder', |
| 7381 | order: 'ASC', |
| 7382 | author: null |
| 7383 | }, |
| 7384 | priority: 50 |
| 7385 | }; |
| 7386 | |
| 7387 | filters.mine = { |
| 7388 | text: l10n.mine, |
| 7389 | props: { |
| 7390 | status: null, |
| 7391 | type: null, |
| 7392 | uploadedTo: null, |
| 7393 | orderby: 'date', |
| 7394 | order: 'DESC', |
| 7395 | author: parseInt( userSettings.uid ) |
7366 | 7396 | }, |
7367 | 7397 | priority: 50 |
7368 | 7398 | }; |
… |
… |
All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.Attachment |
7373 | 7403 | filters.trash = { |
7374 | 7404 | text: l10n.trash, |
7375 | 7405 | props: { |
7376 | | uploadedTo: null, |
7377 | | status: 'trash', |
7378 | | type: null, |
7379 | | orderby: 'date', |
7380 | | order: 'DESC' |
| 7406 | uploadedTo: null, |
| 7407 | status: 'trash', |
| 7408 | type: null, |
| 7409 | orderby: 'date', |
| 7410 | order: 'DESC', |
| 7411 | author: null |
7381 | 7412 | }, |
7382 | 7413 | priority: 50 |
7383 | 7414 | }; |
diff --git a/src/wp-includes/js/media/models/query.js b/src/wp-includes/js/media/models/query.js
index 420e4bb..9debf2c 100644
a
|
b
|
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ |
71 | 71 | // Only observe when a limited number of query args are set. There |
72 | 72 | // are no filters for other properties, so observing will result in |
73 | 73 | // false positives in those queries. |
74 | | allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent' ]; |
| 74 | allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent', 'author' ]; |
75 | 75 | if ( wp.Uploader && _( this.args ).chain().keys().difference( allowed ).isEmpty().value() ) { |
76 | 76 | this.observe( wp.Uploader.queue ); |
77 | 77 | } |
… |
… |
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ |
195 | 195 | 'uploadedTo': 'post_parent', |
196 | 196 | 'status': 'post_status', |
197 | 197 | 'include': 'post__in', |
198 | | 'exclude': 'post__not_in' |
| 198 | 'exclude': 'post__not_in', |
| 199 | 'author': 'author' |
199 | 200 | }, |
200 | 201 | /** |
201 | 202 | * Creates and returns an Attachments Query collection given the properties. |
… |
… |
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ |
217 | 218 | * @param {Object} [props.menu_order] |
218 | 219 | * @param {Object} [props.post_parent] |
219 | 220 | * @param {Object} [props.post_status] |
| 221 | * @param {Object} [props.author] |
220 | 222 | * @param {Object} [options] |
221 | 223 | * |
222 | 224 | * @returns {wp.media.model.Query} A new Attachments Query collection. |
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index a52048f..38e861e 100644
a
|
b
|
function wp_enqueue_media( $args = array() ) { |
3657 | 3657 | 'noItemsFound' => __( 'No items found.' ), |
3658 | 3658 | 'insertIntoPost' => $post_type_object->labels->insert_into_item, |
3659 | 3659 | 'unattached' => __( 'Unattached' ), |
| 3660 | 'mine' => __( 'Mine' ), |
3660 | 3661 | 'trash' => _x( 'Trash', 'noun' ), |
3661 | 3662 | 'uploadedToThisPost' => $post_type_object->labels->uploaded_to_this_item, |
3662 | 3663 | 'warnDelete' => __( "You are about to permanently delete this item from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ), |