<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[43064] branches/4.9/src: Privacy: add "Mine" filter for media similarly to posts and comments.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/43064">43064</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/43064","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2018-05-01 22:03:18 +0000 (Tue, 01 May 2018)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Privacy: add "Mine" filter for media similarly to posts and comments.
Props audrasjb.
Merged <a href="https://core.trac.wordpress.org/changeset/43056">[43056]</a>, <a href="https://core.trac.wordpress.org/changeset/43062">[43062]</a>, <a href="https://core.trac.wordpress.org/changeset/43063">[43063]</a> to the 4.9 branch.
Fixes <a href="https://core.trac.wordpress.org/ticket/43820">#43820</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branches49srcwpadminincludesajaxactionsphp">branches/4.9/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#branches49srcwpadminincludesclasswpmedialisttablephp">branches/4.9/src/wp-admin/includes/class-wp-media-list-table.php</a></li>
<li><a href="#branches49srcwpadminincludespostphp">branches/4.9/src/wp-admin/includes/post.php</a></li>
<li><a href="#branches49srcwpincludesjsmediamodelsqueryjs">branches/4.9/src/wp-includes/js/media/models/query.js</a></li>
<li><a href="#branches49srcwpincludesjsmediaviewsattachmentfiltersalljs">branches/4.9/src/wp-includes/js/media/views/attachment-filters/all.js</a></li>
<li><a href="#branches49srcwpincludesjsmediaviewsattachmentfiltersuploadedjs">branches/4.9/src/wp-includes/js/media/views/attachment-filters/uploaded.js</a></li>
<li><a href="#branches49srcwpincludesjsmediamodelsjs">branches/4.9/src/wp-includes/js/media-models.js</a></li>
<li><a href="#branches49srcwpincludesjsmediaviewsjs">branches/4.9/src/wp-includes/js/media-views.js</a></li>
<li><a href="#branches49srcwpincludesmediaphp">branches/4.9/src/wp-includes/media.php</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#branches49">branches/4.9/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: branches/4.9
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- branches/4.9 2018-05-01 21:46:52 UTC (rev 43063)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ branches/4.9 2018-05-01 22:03:18 UTC (rev 43064)
</ins><a id="branches49"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: branches/4.9</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:mergeinfo</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> /branches/3.1:18031
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/3.3:20543
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/3.4:21757
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/trunk:18512,42132,42134,42136,42138,42140,42144,42146,42148,42150,42152-42153,42155,42157,42159,42161,42163,42169,42171,42173,42175,42177,42181,42183,42185,42187,42189,42191,42193,42199,42203,42210,42214,42220,42222,42226,42242,42244,42247,42251,42256-42261,42350,42358,42362,42364-42368,42374,42388,42390,42401,42417,42421,42423-42425,42430,42433,42437,42441,42443,42446-42447,42449,42451,42453,42457,42459,42462,42491,42521,42529,42531,42533,42536,42538,42541,42543,42545,42549,42566,42568,42570,42572,42574,42576,42579,42581-42582,42584-42585,42587-42588,42590,42592,42594-42595,42598-42599,42602,42604,42606,42611-42613,42615,42617,42624-42625,42639,42648,42652-42653,42665,42687,42711,42713,42719,42722,42739-42740,42744,42758,42792,42801,42817-42818,42830,42837,42839,42841,42844,42851-42852,42860,42864,42881,42892-42894,42930,42998,43007,43025,43027,43030,43032,43034,43036,43039
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/trunk:18512,42132,42134,42136,42138,42140,42144,42146,42148,42150,42152-42153,42155,42157,42159,42161,42163,42169,42171,42173,42175,42177,42181,42183,42185,42187,42189,42191,42193,42199,42203,42210,42214,42220,42222,42226,42242,42244,42247,42251,42256-42261,42350,42358,42362,42364-42368,42374,42388,42390,42401,42417,42421,42423-42425,42430,42433,42437,42441,42443,42446-42447,42449,42451,42453,42457,42459,42462,42491,42521,42529,42531,42533,42536,42538,42541,42543,42545,42549,42566,42568,42570,42572,42574,42576,42579,42581-42582,42584-42585,42587-42588,42590,42592,42594-42595,42598-42599,42602,42604,42606,42611-42613,42615,42617,42624-42625,42639,42648,42652-42653,42665,42687,42711,42713,42719,42722,42739-42740,42744,42758,42792,42801,42817-42818,42830,42837,42839,42841,42844,42851-42852,42860,42864,42881,42892-42894,42930,42998,43007,43025,43027,43030,43032,43034,43036,43039,43056,43062
-43063
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="branches49srcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-admin/includes/ajax-actions.php 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-admin/includes/ajax-actions.php 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2442,7 +2442,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 's', 'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_parent', 'post__in', 'post__not_in', 'year', 'monthnum'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_parent', 'author', 'post__in', 'post__not_in', 'year', 'monthnum'
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( get_taxonomies_for_attachments( 'objects' ) as $t ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $t->query_var && isset( $query[ $t->query_var ] ) ) {
</span></span></pre></div>
<a id="branches49srcwpadminincludesclasswpmedialisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-admin/includes/class-wp-media-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-admin/includes/class-wp-media-list-table.php 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-admin/includes/class-wp-media-list-table.php 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,8 +119,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $label[0]
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $type_links['detached'] = '<option value="detached"' . ( $this->detached ? ' selected="selected"' : '' ) . '>' . __( 'Unattached' ) . '</option>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_links['mine'] = sprintf(
+ '<option value="mine"%s>%s</option>',
+ selected( 'mine' === $filter, true, false ),
+ _x( 'Mine', 'media items' )
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_trash || ( defined( 'MEDIA_TRASH') && MEDIA_TRASH ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $type_links['trash'] = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> '<option value="trash"%s>%s</option>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,6 +135,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> _x( 'Trash', 'attachment filter' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $type_links;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="branches49srcwpadminincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-admin/includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-admin/includes/post.php 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-admin/includes/post.php 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1147,6 +1147,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $q['post_parent'] = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $q['mine'] ) || ( isset( $q['attachment-filter'] ) && 'mine' == $q['attachment-filter'] ) ) {
+ $q['author'] = get_current_user_id();
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Filter query clauses to include filenames.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $q['s'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</span></span></pre></div>
<a id="branches49srcwpincludesjsmediamodelsqueryjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-includes/js/media/models/query.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-includes/js/media/models/query.js 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-includes/js/media/models/query.js 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Only observe when a limited number of query args are set. There
</span><span class="cx" style="display: block; padding: 0 10px"> // are no filters for other properties, so observing will result in
</span><span class="cx" style="display: block; padding: 0 10px"> // false positives in those queries.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent' ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent', 'author' ];
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( wp.Uploader && _( this.args ).chain().keys().difference( allowed ).isEmpty().value() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> this.observe( wp.Uploader.queue );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,14 +188,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @readonly
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> propmap: {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'search': 's',
- 'type': 'post_mime_type',
- 'perPage': 'posts_per_page',
- 'menuOrder': 'menu_order',
- 'uploadedTo': 'post_parent',
- 'status': 'post_status',
- 'include': 'post__in',
- 'exclude': 'post__not_in'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'search': 's',
+ 'type': 'post_mime_type',
+ 'perPage': 'posts_per_page',
+ 'menuOrder': 'menu_order',
+ 'uploadedTo': 'post_parent',
+ 'status': 'post_status',
+ 'include': 'post__in',
+ 'exclude': 'post__not_in',
+ 'author': 'author'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Creates and returns an Attachments Query collection given the properties.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,6 +218,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [props.menu_order]
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [props.post_parent]
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [props.post_status]
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {Object} [props.author]
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [options]
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {wp.media.model.Query} A new Attachments Query collection.
</span></span></pre></div>
<a id="branches49srcwpincludesjsmediaviewsattachmentfiltersalljs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-includes/js/media/views/attachment-filters/all.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-includes/js/media/views/attachment-filters/all.js 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-includes/js/media/views/attachment-filters/all.js 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.All.prototype */{
</span><span class="cx" style="display: block; padding: 0 10px"> createFilters: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var filters = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filters = {},
+ uid = window.userSettings ? parseInt( window.userSettings.uid, 10 ) : 0;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( wp.media.view.settings.mimeTypes || {}, function( text, key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> filters[ key ] = {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +25,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> type: key,
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'date',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'DESC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'DESC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +38,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> type: null,
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'date',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'DESC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'DESC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 10
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +52,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> type: null,
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: wp.media.view.settings.post.id,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'menuOrder',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'ASC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'ASC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 20
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,11 +66,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: 0,
</span><span class="cx" style="display: block; padding: 0 10px"> type: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'menuOrder',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'ASC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'ASC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 50
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( uid ) {
+ filters.mine = {
+ text: l10n.mine,
+ props: {
+ status: null,
+ type: null,
+ uploadedTo: null,
+ orderby: 'date',
+ order: 'DESC',
+ author: uid
+ },
+ priority: 50
+ };
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( wp.media.view.settings.mediaTrash &&
</span><span class="cx" style="display: block; padding: 0 10px"> this.controller.isModeActive( 'grid' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,7 +97,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> status: 'trash',
</span><span class="cx" style="display: block; padding: 0 10px"> type: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'date',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'DESC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'DESC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 50
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span></span></pre></div>
<a id="branches49srcwpincludesjsmediaviewsattachmentfiltersuploadedjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-includes/js/media/views/attachment-filters/uploaded.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-includes/js/media/views/attachment-filters/uploaded.js 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-includes/js/media/views/attachment-filters/uploaded.js 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,6 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> createFilters: function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var type = this.model.get('type'),
</span><span class="cx" style="display: block; padding: 0 10px"> types = wp.media.view.settings.mimeTypes,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ uid = window.userSettings ? parseInt( window.userSettings.uid, 10 ) : 0,
</ins><span class="cx" style="display: block; padding: 0 10px"> text;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( types && type ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +29,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> props: {
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'date',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'DESC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'DESC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 10
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +40,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> props: {
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: wp.media.view.settings.post.id,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'menuOrder',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'ASC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'ASC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 20
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,11 +51,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> props: {
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: 0,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'menuOrder',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'ASC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'ASC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 50
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( uid ) {
+ this.filters.mine = {
+ text: l10n.mine,
+ props: {
+ orderby: 'date',
+ order: 'DESC',
+ author: uid
+ },
+ priority: 50
+ };
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="branches49srcwpincludesjsmediamodelsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-includes/js/media-models.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-includes/js/media-models.js 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-includes/js/media-models.js 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1121,7 +1121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Only observe when a limited number of query args are set. There
</span><span class="cx" style="display: block; padding: 0 10px"> // are no filters for other properties, so observing will result in
</span><span class="cx" style="display: block; padding: 0 10px"> // false positives in those queries.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent' ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent', 'author' ];
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( wp.Uploader && _( this.args ).chain().keys().difference( allowed ).isEmpty().value() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> this.observe( wp.Uploader.queue );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1238,14 +1238,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @readonly
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> propmap: {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'search': 's',
- 'type': 'post_mime_type',
- 'perPage': 'posts_per_page',
- 'menuOrder': 'menu_order',
- 'uploadedTo': 'post_parent',
- 'status': 'post_status',
- 'include': 'post__in',
- 'exclude': 'post__not_in'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'search': 's',
+ 'type': 'post_mime_type',
+ 'perPage': 'posts_per_page',
+ 'menuOrder': 'menu_order',
+ 'uploadedTo': 'post_parent',
+ 'status': 'post_status',
+ 'include': 'post__in',
+ 'exclude': 'post__not_in',
+ 'author': 'author'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Creates and returns an Attachments Query collection given the properties.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1267,6 +1268,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [props.menu_order]
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [props.post_parent]
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [props.post_status]
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {Object} [props.author]
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [options]
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {wp.media.model.Query} A new Attachments Query collection.
</span></span></pre></div>
<a id="branches49srcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-includes/js/media-views.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-includes/js/media-views.js 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-includes/js/media-views.js 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7022,6 +7022,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> createFilters: function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var type = this.model.get('type'),
</span><span class="cx" style="display: block; padding: 0 10px"> types = wp.media.view.settings.mimeTypes,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ uid = window.userSettings ? parseInt( window.userSettings.uid, 10 ) : 0,
</ins><span class="cx" style="display: block; padding: 0 10px"> text;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( types && type ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7034,7 +7035,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> props: {
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'date',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'DESC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'DESC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 10
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7044,7 +7046,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> props: {
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: wp.media.view.settings.post.id,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'menuOrder',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'ASC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'ASC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 20
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7054,11 +7057,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> props: {
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: 0,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'menuOrder',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'ASC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'ASC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 50
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( uid ) {
+ this.filters.mine = {
+ text: l10n.mine,
+ props: {
+ orderby: 'date',
+ order: 'DESC',
+ author: uid
+ },
+ priority: 50
+ };
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7085,7 +7101,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.All.prototype */{
</span><span class="cx" style="display: block; padding: 0 10px"> createFilters: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var filters = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filters = {},
+ uid = window.userSettings ? parseInt( window.userSettings.uid, 10 ) : 0;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( wp.media.view.settings.mimeTypes || {}, function( text, key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> filters[ key ] = {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7095,7 +7112,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> type: key,
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'date',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'DESC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'DESC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7107,7 +7125,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> type: null,
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'date',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'DESC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'DESC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 10
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7120,7 +7139,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> type: null,
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: wp.media.view.settings.post.id,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'menuOrder',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'ASC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'ASC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 20
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7133,11 +7153,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> uploadedTo: 0,
</span><span class="cx" style="display: block; padding: 0 10px"> type: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'menuOrder',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'ASC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'ASC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 50
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( uid ) {
+ filters.mine = {
+ text: l10n.mine,
+ props: {
+ status: null,
+ type: null,
+ uploadedTo: null,
+ orderby: 'date',
+ order: 'DESC',
+ author: uid
+ },
+ priority: 50
+ };
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( wp.media.view.settings.mediaTrash &&
</span><span class="cx" style="display: block; padding: 0 10px"> this.controller.isModeActive( 'grid' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7148,7 +7184,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> status: 'trash',
</span><span class="cx" style="display: block; padding: 0 10px"> type: null,
</span><span class="cx" style="display: block; padding: 0 10px"> orderby: 'date',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- order: 'DESC'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ order: 'DESC',
+ author: null
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> priority: 50
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span></span></pre></div>
<a id="branches49srcwpincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/4.9/src/wp-includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/4.9/src/wp-includes/media.php 2018-05-01 21:46:52 UTC (rev 43063)
+++ branches/4.9/src/wp-includes/media.php 2018-05-01 22:03:18 UTC (rev 43064)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3523,6 +3523,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'noItemsFound' => __( 'No items found.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'insertIntoPost' => $post_type_object->labels->insert_into_item,
</span><span class="cx" style="display: block; padding: 0 10px"> 'unattached' => __( 'Unattached' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'mine' => _x( 'Mine', 'media items' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'trash' => _x( 'Trash', 'noun' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'uploadedToThisPost' => $post_type_object->labels->uploaded_to_this_item,
</span><span class="cx" style="display: block; padding: 0 10px"> 'warnDelete' => __( "You are about to permanently delete this item from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ),
</span></span></pre>
</div>
</div>
</body>
</html>