Docs: Correct @since tags for new properties and functions related to infinite scrolling in Media Library.

Follow-up to [50829].

See #50105, #40330, #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50831 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-05-08 11:20:02 +00:00
parent 89989405ae
commit f8a5eb35e1
6 changed files with 16 additions and 13 deletions

View File

@ -350,14 +350,14 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
/**
* Holds the total number of attachments.
*
* @since 5.7.0
* @since 5.8.0
*/
totalAttachments: 0,
/**
* Gets the total number of attachments.
*
* @since 5.7.0
* @since 5.8.0
*
* @return {number} The total number of attachments.
*/
@ -368,15 +368,15 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
/**
* A custom Ajax-response parser.
*
* See trac ticket #24753
* See trac ticket #24753.
*
* Called automatically by Backbone whenever a collection's models are returned
* by the server, in fetch. The default implementation is a no-op, simply
* passing through the JSON response. We override this to add attributes to
* the collection items.
*
* Since WordPress 5.5, the response returns the attachments under `response.attachments`
* and `response.totalAttachments` holds the total number of attachments found.
* @since 5.8.0 The response returns the attachments under `response.attachments` and
* `response.totalAttachments` holds the total number of attachments found.
*
* @param {Object|Array} response The raw response Object/Array.
* @param {Object} xhr
@ -384,7 +384,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
*/
parse: function( response, xhr ) {
if ( ! _.isArray( response.attachments ) ) {
response = [response.attachments];
response = [ response.attachments ];
}
this.totalAttachments = parseInt( response.totalAttachments, 10 );

View File

@ -113,7 +113,6 @@ Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
options.remove = false;
return this._more = this.fetch( options ).done( function( response ) {
// Since WordPress 5.5, the response returns the attachments under `response.attachments`.
var attachments = response.attachments;
if ( _.isEmpty( attachments ) || -1 === this.args.posts_per_page || attachments.length < this.args.posts_per_page ) {

View File

@ -36,6 +36,8 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{
this.el.id = _.uniqueId('__attachments-view-');
/**
* @since 5.8.0 Added the `infiniteScrolling` parameter.
*
* @param infiniteScrolling Whether to enable infinite scrolling or use
* the default "load more" button.
* @param refreshSensitivity The time in milliseconds to throttle the scroll

View File

@ -456,7 +456,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
/**
* Creates the Attachments wrapper view.
*
* @since 5.7.0
* @since 5.8.0
*
* @return {void}
*/
@ -506,7 +506,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
/**
* Creates the load more button and attachments counter view.
*
* @since 5.7.0
* @since 5.8.0
*
* @return {void}
*/
@ -557,7 +557,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
* collection updates multiple times at the add, remove, and reset events.
* We need it to run only once, after all attachments are added or removed.
*
* @since 5.7.0
* @since 5.8.0
*
* @return {void}
*/
@ -610,7 +610,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
/**
* Loads more attachments.
*
* @since 5.7.0
* @since 5.8.0
*
* @return {void}
*/
@ -645,7 +645,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
/**
* Moves focus to the first new added item. .
*
* @since 5.7.0
* @since 5.8.0
*
* @return {void}
*/

View File

@ -2927,6 +2927,8 @@ function wp_ajax_get_attachment() {
* Ajax handler for querying attachments.
*
* @since 3.5.0
* @since 5.8.0 The response returns the attachments under `response.attachments` and
* `response.totalAttachments` holds the total number of attachments found.
*/
function wp_ajax_query_attachments() {
if ( ! current_user_can( 'upload_files' ) ) {

View File

@ -4309,7 +4309,7 @@ function wp_enqueue_media( $args = array() ) {
/**
* Filters whether the Media Library grid has infinite scrolling. Default `false`.
*
* @since 5.7.0
* @since 5.8.0
*
* @param bool $value The filtered value, defaults to `false`.
*/