diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 968a5a3985..275cc4cea6 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -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' ) ) { diff --git a/wp-includes/js/media-models.js b/wp-includes/js/media-models.js index a356b9d05f..c49303de8f 100644 --- a/wp-includes/js/media-models.js +++ b/wp-includes/js/media-models.js @@ -876,14 +876,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. */ @@ -894,15 +894,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 @@ -910,7 +910,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 ); @@ -1226,7 +1226,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 ) { diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 02822065b6..15e8214362 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -7197,6 +7197,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 @@ -8464,7 +8466,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} */ @@ -8514,7 +8516,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} */ @@ -8565,7 +8567,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} */ @@ -8618,7 +8620,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro /** * Loads more attachments. * - * @since 5.7.0 + * @since 5.8.0 * * @return {void} */ @@ -8653,7 +8655,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} */ diff --git a/wp-includes/media.php b/wp-includes/media.php index b3dfeb0c6f..19fa2b8b9d 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -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`. */ diff --git a/wp-includes/version.php b/wp-includes/version.php index 13055feb9c..95bff56724 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @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.