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

Follow-up to [50829].

See #50105, #40330, #52628.
Built from https://develop.svn.wordpress.org/trunk@50831


git-svn-id: http://core.svn.wordpress.org/trunk@50440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-05-08 11:22:03 +00:00
parent 34e71f3d94
commit f30138fd8a
5 changed files with 17 additions and 14 deletions

View File

@ -2927,6 +2927,8 @@ function wp_ajax_get_attachment() {
* Ajax handler for querying attachments. * Ajax handler for querying attachments.
* *
* @since 3.5.0 * @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() { function wp_ajax_query_attachments() {
if ( ! current_user_can( 'upload_files' ) ) { if ( ! current_user_can( 'upload_files' ) ) {

View File

@ -876,14 +876,14 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
/** /**
* Holds the total number of attachments. * Holds the total number of attachments.
* *
* @since 5.7.0 * @since 5.8.0
*/ */
totalAttachments: 0, totalAttachments: 0,
/** /**
* Gets the total number of attachments. * Gets the total number of attachments.
* *
* @since 5.7.0 * @since 5.8.0
* *
* @return {number} The total number of attachments. * @return {number} The total number of attachments.
*/ */
@ -894,15 +894,15 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
/** /**
* A custom Ajax-response parser. * A custom Ajax-response parser.
* *
* See trac ticket #24753 * See trac ticket #24753.
* *
* Called automatically by Backbone whenever a collection's models are returned * Called automatically by Backbone whenever a collection's models are returned
* by the server, in fetch. The default implementation is a no-op, simply * 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 * passing through the JSON response. We override this to add attributes to
* the collection items. * the collection items.
* *
* Since WordPress 5.5, the response returns the attachments under `response.attachments` * @since 5.8.0 The response returns the attachments under `response.attachments` and
* and `response.totalAttachments` holds the total number of attachments found. * `response.totalAttachments` holds the total number of attachments found.
* *
* @param {Object|Array} response The raw response Object/Array. * @param {Object|Array} response The raw response Object/Array.
* @param {Object} xhr * @param {Object} xhr
@ -1226,7 +1226,6 @@ Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
options.remove = false; options.remove = false;
return this._more = this.fetch( options ).done( function( response ) { 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; var attachments = response.attachments;
if ( _.isEmpty( attachments ) || -1 === this.args.posts_per_page || attachments.length < this.args.posts_per_page ) { if ( _.isEmpty( attachments ) || -1 === this.args.posts_per_page || attachments.length < this.args.posts_per_page ) {

View File

@ -7197,6 +7197,8 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{
this.el.id = _.uniqueId('__attachments-view-'); this.el.id = _.uniqueId('__attachments-view-');
/** /**
* @since 5.8.0 Added the `infiniteScrolling` parameter.
*
* @param infiniteScrolling Whether to enable infinite scrolling or use * @param infiniteScrolling Whether to enable infinite scrolling or use
* the default "load more" button. * the default "load more" button.
* @param refreshSensitivity The time in milliseconds to throttle the scroll * @param refreshSensitivity The time in milliseconds to throttle the scroll
@ -8464,7 +8466,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
/** /**
* Creates the Attachments wrapper view. * Creates the Attachments wrapper view.
* *
* @since 5.7.0 * @since 5.8.0
* *
* @return {void} * @return {void}
*/ */
@ -8514,7 +8516,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
/** /**
* Creates the load more button and attachments counter view. * Creates the load more button and attachments counter view.
* *
* @since 5.7.0 * @since 5.8.0
* *
* @return {void} * @return {void}
*/ */
@ -8565,7 +8567,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
* collection updates multiple times at the add, remove, and reset events. * 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. * We need it to run only once, after all attachments are added or removed.
* *
* @since 5.7.0 * @since 5.8.0
* *
* @return {void} * @return {void}
*/ */
@ -8618,7 +8620,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
/** /**
* Loads more attachments. * Loads more attachments.
* *
* @since 5.7.0 * @since 5.8.0
* *
* @return {void} * @return {void}
*/ */
@ -8653,7 +8655,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
/** /**
* Moves focus to the first new added item. . * Moves focus to the first new added item. .
* *
* @since 5.7.0 * @since 5.8.0
* *
* @return {void} * @return {void}
*/ */

View File

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

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.8-alpha-50830'; $wp_version = '5.8-alpha-50831';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.