From bbf4573bbcd915246e6168ee57d1afada42aec4e Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Fri, 11 Sep 2026 08:35:20 +0200 Subject: [PATCH 01/23] Enable JSDoc valid-types. --- .eslintrc-jsdoc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc-jsdoc.js b/.eslintrc-jsdoc.js index 93c13a857b7b3..f38d3ad3ef4d3 100644 --- a/.eslintrc-jsdoc.js +++ b/.eslintrc-jsdoc.js @@ -75,6 +75,7 @@ module.exports = [ 'jsdoc/require-returns-check': 'error', 'jsdoc/require-returns-description': 'error', 'jsdoc/require-returns-type': 'error', + 'jsdoc/valid-types': 'error', }, }, ]; From 3a7da74a7eb558e34682b0616925cbc4d89a3cde Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 15:35:09 +0200 Subject: [PATCH 02/23] Remove non-standard JSDoc liatens. --- src/js/_enqueues/admin/comment.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/js/_enqueues/admin/comment.js b/src/js/_enqueues/admin/comment.js index d2ebafbcf4834..5ed06b0fa41f7 100644 --- a/src/js/_enqueues/admin/comment.js +++ b/src/js/_enqueues/admin/comment.js @@ -24,8 +24,6 @@ jQuery( function($) { /** * Adds event that opens the time stamp form if the form is hidden. * - * @listens $edittimestamp:click - * * @param {Event} event The event object. * @return {void} */ @@ -43,8 +41,6 @@ jQuery( function($) { /** * Resets the time stamp values when the cancel button is clicked. * - * @listens .cancel-timestamp:click - * * @param {Event} event The event object. * @return {void} */ @@ -65,8 +61,6 @@ jQuery( function($) { /** * Sets the time stamp values when the ok button is clicked. * - * @listens .save-timestamp:click - * * @param {Event} event The event object. * @return {void} */ @@ -110,8 +104,6 @@ jQuery( function($) { * * @since 7.1.0 * - * @listens $editcommentparent:click - * * @param {Event} event The event object. * @return {void} */ @@ -131,8 +123,6 @@ jQuery( function($) { * * @since 7.1.0 * - * @listens .cancel-comment-parent:click - * * @param {Event} event The event object. * @return {void} */ @@ -150,8 +140,6 @@ jQuery( function($) { * * @since 7.1.0 * - * @listens .save-comment-parent:click - * * @param {Event} event The event object. * @return {void} */ From 5fc6bde7d9e39d88a482896e28ae2680ea846004 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 15:47:50 +0200 Subject: [PATCH 03/23] Fix valid types in inline-edit-tax.js file. --- src/js/_enqueues/admin/inline-edit-tax.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/_enqueues/admin/inline-edit-tax.js b/src/js/_enqueues/admin/inline-edit-tax.js index cedbefa256d93..f22633651a70c 100644 --- a/src/js/_enqueues/admin/inline-edit-tax.js +++ b/src/js/_enqueues/admin/inline-edit-tax.js @@ -29,7 +29,7 @@ window.inlineEditTax = { * * @since 2.7.0 * - * @this inlineEditTax + * @this {inlineEditTax} * @memberof inlineEditTax * @return {void} */ @@ -93,7 +93,7 @@ window.inlineEditTax = { * * @since 2.7.0 * - * @this inlineEditTax + * @this {inlineEditTax} * @memberof inlineEditTax * * @param {HTMLElement} el An element within the table row or the table row @@ -111,7 +111,7 @@ window.inlineEditTax = { * * @since 2.7.0 * - * @this inlineEditTax + * @this {inlineEditTax} * @memberof inlineEditTax * * @param {string|HTMLElement} id The ID of the term we want to quick edit or an @@ -158,7 +158,7 @@ window.inlineEditTax = { * * @since 2.7.0 * - * @this inlineEditTax + * @this {inlineEditTax} * @memberof inlineEditTax * * @param {string|HTMLElement} id The ID of the term we want to quick edit or an @@ -255,7 +255,7 @@ window.inlineEditTax = { * * @since 2.7.0 * - * @this inlineEditTax + * @this {inlineEditTax} * @memberof inlineEditTax * @return {void} */ From c952955533ef6ff3671855ffba057abda8110ccc Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 15:49:48 +0200 Subject: [PATCH 04/23] Fix valid types in user-profile.js file. --- src/js/_enqueues/admin/user-profile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/_enqueues/admin/user-profile.js b/src/js/_enqueues/admin/user-profile.js index dc0b5e8ccd6e0..27a01211636fd 100644 --- a/src/js/_enqueues/admin/user-profile.js +++ b/src/js/_enqueues/admin/user-profile.js @@ -186,10 +186,10 @@ /** * Helper function to insert an inline notice of success or failure. * - * @param {jQuery Object} $this The button element: the message will be inserted - * above this button - * @param {boolean} success Whether the message is a success message. - * @param {string} message The message to insert. + * @param {jQuery} $this The button element: the message will be inserted + * above this button + * @param {boolean} success Whether the message is a success message. + * @param {string} message The message to insert. */ function addInlineNotice( $this, success, message ) { var resultDiv = $( '
', { From 043dda7e70da8432bcbe66c8826c9b8b0997e5e0 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 15:58:13 +0200 Subject: [PATCH 05/23] Fix valid types in lists.js file. --- src/js/_enqueues/lib/lists.js | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/js/_enqueues/lib/lists.js b/src/js/_enqueues/lib/lists.js index deb1814bf9214..43672c9a5aaf5 100644 --- a/src/js/_enqueues/lib/lists.js +++ b/src/js/_enqueues/lib/lists.js @@ -812,31 +812,31 @@ wpList = { /** * Initializes wpList object. * - * @param {Object} settings The settings for the wpList instance. - * @param {string} settings.url URL for ajax calls. Default: ajaxurl. - * @param {string} settings.type The HTTP method to use for Ajax requests. Default: 'POST'. - * @param {string} settings.response ID of the element the parsed ajax response will be stored in. - * Default: 'ajax-response'. + * @param {Object} settings The settings for the wpList instance. + * @param {string} settings.url URL for ajax calls. Default: ajaxurl. + * @param {string} settings.type The HTTP method to use for Ajax requests. Default: 'POST'. + * @param {string} settings.response ID of the element the parsed ajax response will be stored in. + * Default: 'ajax-response'. * - * @param {string} settings.what Default: ''. - * @param {string} settings.alt CSS class name for alternate styling. Default: 'alternate'. - * @param {number} settings.altOffset Offset to start alternate styling from. Default: 0. - * @param {string} settings.addColor Hex code or 'none' to disable animation. Default: '#ffff33'. - * @param {string} settings.delColor Hex code or 'none' to disable animation. Default: '#faafaa'. - * @param {string} settings.dimAddColor Hex code or 'none' to disable animation. Default: '#ffff33'. - * @param {string} settings.dimDelColor Hex code or 'none' to disable animation. Default: '#ff3333'. + * @param {string} settings.what Default: ''. + * @param {string} settings.alt CSS class name for alternate styling. Default: 'alternate'. + * @param {number} settings.altOffset Offset to start alternate styling from. Default: 0. + * @param {string} settings.addColor Hex code or 'none' to disable animation. Default: '#ffff33'. + * @param {string} settings.delColor Hex code or 'none' to disable animation. Default: '#faafaa'. + * @param {string} settings.dimAddColor Hex code or 'none' to disable animation. Default: '#ffff33'. + * @param {string} settings.dimDelColor Hex code or 'none' to disable animation. Default: '#ff3333'. * - * @param {wpList~confirm} settings.confirm Callback that's run before a request is made. Default: null. - * @param {wpList~addBefore} settings.addBefore Callback that's run before an item gets added to the list. - * Default: null. - * @param {wpList~addAfter} settings.addAfter Callback that's run after an item got added to the list. - * Default: null. - * @param {wpList~delBefore} settings.delBefore Callback that's run before an item gets deleted from the list. - * Default: null. - * @param {wpList~delAfter} settings.delAfter Callback that's run after an item got deleted from the list. - * Default: null. - * @param {wpList~dimBefore} settings.dimBefore Callback that's run before an item gets dim'd. Default: null. - * @param {wpList~dimAfter} settings.dimAfter Callback that's run after an item got dim'd. Default: null. + * @param {Function} settings.confirm Callback that's run before a request is made. Default: null. + * @param {Function} settings.addBefore Callback that's run before an item gets added to the list. + * Default: null. + * @param {Function} settings.addAfter Callback that's run after an item got added to the list. + * Default: null. + * @param {Function} settings.delBefore Callback that's run before an item gets deleted from the list. + * Default: null. + * @param {Function} settings.delAfter Callback that's run after an item got deleted from the list. + * Default: null. + * @param {Function} settings.dimBefore Callback that's run before an item gets dim'd. Default: null. + * @param {Function} settings.dimAfter Callback that's run after an item got dim'd. Default: null. * @return {$.fn} wpList API function. */ $.fn.wpList = function( settings ) { From 5ca72011d2f04caa025fb737e4dcbb99ab7d1bed Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:09:18 +0200 Subject: [PATCH 06/23] Fix valid types in wp api.js file. --- src/js/_enqueues/wp/api.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/js/_enqueues/wp/api.js b/src/js/_enqueues/wp/api.js index c91558b20a200..a4e5c468ee64f 100644 --- a/src/js/_enqueues/wp/api.js +++ b/src/js/_enqueues/wp/api.js @@ -60,7 +60,7 @@ * Determine model based on API route. * * @param {string} route The API route. - * @return {Backbone Model} The model found at given route. Undefined if not found. + * @return {Backbone.Model|undefined} The model found at given route. Undefined if not found. */ wp.api.getModelByRoute = function( route ) { return _.find( wp.api.models, function( model ) { @@ -72,7 +72,7 @@ * Determine collection based on API route. * * @param {string} route The API route. - * @return {Backbone Model} The collection found at given route. Undefined if not found. + * @return {Backbone.Collection|undefined} The collection found at given route. Undefined if not found. */ wp.api.getCollectionByRoute = function( route ) { return _.find( wp.api.collections, function( collection ) { @@ -311,7 +311,7 @@ /** * Add mixins and helpers to models depending on their defaults. * - * @param {Backbone Model} model The model to attach helpers and mixins to. + * @param {Backbone.Model} model The model to attach helpers and mixins to. * @param {string} modelClassName The classname of the constructed model. * @param {Object} loadingObjects An object containing the models and collections we are building. * @return {undefined} No return value. @@ -868,15 +868,13 @@ /** * Set nonce header before every Backbone sync. * - * @param {string} method The CRUD method ("create", "read", "update", or "delete") to be performed. - * @param {Backbone.Model} model The model to be synced. - * @param {{beforeSend}, *} options Additional options for the sync. + * @param {string} method The CRUD method ("create", "read", "update", or "delete") to be performed. + * @param {Backbone.Model} model The model to be synced. + * @param {Object} options Additional options for the sync. * @return {*}. */ sync: function( method, model, options ) { - var beforeSend; - - options = options || {}; + var Object; options = options || {}; // Remove date_gmt if null. if ( _.isNull( model.get( 'date_gmt' ) ) ) { @@ -1033,7 +1031,7 @@ * * @param {string} method The CRUD method ("create", "read", "update", or "delete") to be performed. * @param {Backbone.Model} model The model to be synced. - * @param {{success}, *} options Additional options for the sync. + * @param {Object} options Additional options for the sync. * @return {*}. */ sync: function( method, model, options ) { @@ -1108,8 +1106,9 @@ /** * Fetches the next page of objects if a new page exists. * - * @param {data: {page}} options An object containing the page number to fetch. If not provided, the next page will be fetched. - * @return {*}. + * @param {Object} [options] An object containing the page number to fetch. If not provided, the next page will be fetched. + * @param {number} [options.data.page] The page number to fetch. + * @return {*} The result of the fetch operation. */ more: function( options ) { options = options || {}; From bad3cbef92526bac868d119380b2c7c24875b4ab Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:17:40 +0200 Subject: [PATCH 07/23] Fix valid types in wp media editor.js file. --- src/js/_enqueues/wp/media/editor.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/js/_enqueues/wp/media/editor.js b/src/js/_enqueues/wp/media/editor.js index 3c0678c38e6d6..47eb074aaa8ce 100644 --- a/src/js/_enqueues/wp/media/editor.js +++ b/src/js/_enqueues/wp/media/editor.js @@ -490,7 +490,7 @@ * @param {string} content Content that is searched for possible * shortcode markup matching the passed tag name, * - * @this wp.media.{prop} + * @this {wp.media.view.MediaFrame.Select} * * @return {void|wp.media.view.MediaFrame.Select} A media workflow. */ @@ -649,7 +649,7 @@ /** * The Featured Image workflow * - * @this wp.media.featuredImage + * @this {wp.media.featuredImage} * * @return {wp.media.view.MediaFrame.Select} A media workflow. */ @@ -666,7 +666,7 @@ this._frame.on( 'toolbar:create:featured-image', function( toolbar ) { /** - * @this wp.media.view.MediaFrame.Select + * @this {wp.media.view.MediaFrame.Select} */ this.createSelectToolbar( toolbar, { text: wp.media.view.l10n.setFeaturedImage @@ -691,7 +691,7 @@ * 'select' callback for Featured Image workflow, triggered when * the 'Set Featured Image' button is clicked in the media modal. * - * @this wp.media.controller.FeaturedImage + * @this {wp.media.controller.FeaturedImage} */ select: function() { var selection = this.get('selection').single(); @@ -789,7 +789,7 @@ * @param {string} id A slug used to identify the workflow. * @param {Object} [options={}] The options for the media workflow. * - * @this wp.media.editor + * @this {wp.media.editor} * * @return {wp.media.view.MediaFrame.Select} A media workflow. */ @@ -820,7 +820,7 @@ $.when.apply( $, selection.map( function( attachment ) { var display = state.display( attachment ).toJSON(); /** - * @this wp.media.editor + * @this {wp.media.editor} */ return this.send.attachment( display, attachment.toJSON() ); }, this ) ).done( function() { @@ -830,28 +830,28 @@ workflow.state('gallery-edit').on( 'update', function( selection ) { /** - * @this wp.media.editor + * @this {wp.media.editor} */ this.insert( wp.media.gallery.shortcode( selection ).string() ); }, this ); workflow.state('playlist-edit').on( 'update', function( selection ) { /** - * @this wp.media.editor + * @this {wp.media.editor} */ this.insert( wp.media.playlist.shortcode( selection ).string() ); }, this ); workflow.state('video-playlist-edit').on( 'update', function( selection ) { /** - * @this wp.media.editor + * @this {wp.media.editor} */ this.insert( wp.media.playlist.shortcode( selection ).string() ); }, this ); workflow.state('embed').on( 'select', function() { /** - * @this wp.media.editor + * @this {wp.media.editor} */ var state = workflow.state(), type = state.get('type'), @@ -920,7 +920,7 @@ * * @param {string} id A slug used to identify the workflow. * - * @this wp.media.editor + * @this {wp.media.editor} * * @return {wp.media.view.MediaFrame} A media workflow. */ @@ -933,7 +933,7 @@ * * @param {string} id A slug used to identify the workflow. * - * @this wp.media.editor + * @this {wp.media.editor} */ remove: function( id ) { id = this.id( id ); @@ -1020,7 +1020,7 @@ * @param {string} [id=undefined] Optional. A slug used to identify the workflow. * @param {Object} [options={}] The options for the media workflow. * - * @this wp.media.editor + * @this {wp.media.editor} * * @return {wp.media.view.MediaFrame} A media workflow. */ From d978758c21fd03ce32c66c99e05d7caaf5986d47 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:25:58 +0200 Subject: [PATCH 08/23] Remove docblock for local variable in theme.js file. --- src/js/_enqueues/wp/theme.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 3479aee73a05d..ff5d72ad2801e 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -275,10 +275,6 @@ themes.Collection = Backbone.Collection.extend({ * which triggers events of `query:success` or `query:fail`. */ query: function( request ) { - /** - * @static - * @type Array - */ var queries = this.queries, self = this, query, isPaginated, count; From da42376f76081fdc0f3fc86e01c9efaf84ec8e24 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:27:10 +0200 Subject: [PATCH 09/23] Fix valid types in widgets media.js file. --- src/js/_enqueues/wp/widgets/media.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/wp/widgets/media.js b/src/js/_enqueues/wp/widgets/media.js index 5d339308c5881..ce366361d5862 100644 --- a/src/js/_enqueues/wp/widgets/media.js +++ b/src/js/_enqueues/wp/widgets/media.js @@ -375,7 +375,7 @@ wp.mediaWidgets = ( function( $ ) { * * @ignore * - * @fires wp.media.controller.State#insert() + * @fires wp.media.controller.State#insert * @return {void} */ click: function onClick() { From dc86b1fa7645782e4c7e23dd9c5292ca674d6aea Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:28:10 +0200 Subject: [PATCH 10/23] Fix valid types in media models attachment.js file. --- src/js/media/models/attachment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/media/models/attachment.js b/src/js/media/models/attachment.js index 5c18eec27bf11..6a911b147f372 100644 --- a/src/js/media/models/attachment.js +++ b/src/js/media/models/attachment.js @@ -118,7 +118,7 @@ Attachment = Backbone.Model.extend(/** @lends wp.media.model.Attachment.prototyp * @param {Object} data The properties to be saved. * @param {Object} options Sync options. e.g. patch, wait, success, error. * - * @this Backbone.Model + * @this {Backbone.Model} * * @return {jQuery.Promise} A jQuery Promise that is resolved or rejected based on the success of the sync operation. */ From a3679805e7226aedcc3d781c991e9f238dfcdaa2 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:29:19 +0200 Subject: [PATCH 11/23] Fix valid types in media models attachments.js file. --- src/js/media/models/attachments.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/media/models/attachments.js b/src/js/media/models/attachments.js index 98d60e34726f5..b84b782ca5fc7 100644 --- a/src/js/media/models/attachments.js +++ b/src/js/media/models/attachments.js @@ -544,7 +544,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen * * @param {wp.media.model.Attachment} attachment The attachment to filter based on the search query. * - * @this wp.media.model.Attachments + * @this {wp.media.model.Attachments} * * @return {boolean} True if the attachment matches the search filter, false otherwise. */ @@ -564,7 +564,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen * @static * @param {wp.media.model.Attachment} attachment The attachment to filter based on its type. * - * @this wp.media.model.Attachments + * @this {wp.media.model.Attachments} * * @return {boolean} True if the attachment matches the type filter, false otherwise. */ @@ -593,7 +593,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen * @static * @param {wp.media.model.Attachment} attachment The attachment to filter based on its uploadedTo property. * - * @this wp.media.model.Attachments + * @this {wp.media.model.Attachments} * * @return {boolean} True if the attachment matches the uploadedTo filter, false otherwise. */ @@ -611,7 +611,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen * @static * @param {wp.media.model.Attachment} attachment The attachment to filter based on its status property. * - * @this wp.media.model.Attachments + * @this {wp.media.model.Attachments} * * @return {boolean} True if the attachment matches the status filter, false otherwise. */ From 9df8a6943666766bef6df6bfdac0bcf58135a36a Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:30:28 +0200 Subject: [PATCH 12/23] Remove docblock for local variable in media models query.js file. --- src/js/media/models/query.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/js/media/models/query.js b/src/js/media/models/query.js index 74559c8320b3e..0c4b634cb5ffd 100644 --- a/src/js/media/models/query.js +++ b/src/js/media/models/query.js @@ -231,10 +231,6 @@ Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ * @return {wp.media.model.Query} A new Attachments Query collection. */ get: (function(){ - /** - * @static - * @type Array - */ var queries = []; /** From f8c9155c06cc9acd470a30eb3ba83344065c295c Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:36:30 +0200 Subject: [PATCH 13/23] Remove invalid fires notations in media models selection.js file. --- src/js/media/models/selection.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/js/media/models/selection.js b/src/js/media/models/selection.js index 7e03ce4f4119e..a0e301b37a685 100644 --- a/src/js/media/models/selection.js +++ b/src/js/media/models/selection.js @@ -52,11 +52,9 @@ Selection = Attachments.extend(/** @lends wp.media.model.Selection.prototype */{ /** * Fired when toggling (clicking on) an attachment in the modal. * - * @param {undefined|boolean|wp.media.model.Attachment} model The model to set as the single selection, or a boolean to clear it. - * - * @fires wp.media.model.Selection#selection:single - * @fires wp.media.model.Selection#selection:unsingle + * Fires `selection:single` and `selection:unsingle` events on the model and collection. * + * @param {undefined|boolean|wp.media.model.Attachment} model The model to set as the single selection, or a boolean to clear it. * @return {Backbone.Model} The single model in the selection, or the last model as a fallback. */ single: function( model ) { From 550deddfb664898d066d95e30a73c50976fd6ba3 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:44:15 +0200 Subject: [PATCH 14/23] Remove invalid fires notations in media views attachment details.js file. --- src/js/media/views/attachment/details.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/js/media/views/attachment/details.js b/src/js/media/views/attachment/details.js index a4ed635b62442..8317dbdfdada5 100644 --- a/src/js/media/views/attachment/details.js +++ b/src/js/media/views/attachment/details.js @@ -246,10 +246,9 @@ Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototyp * * This event can be used to make sure to move the focus correctly. * - * @since 4.0.0 + * Fires `attachment:details:shift-tab` and `attachment:keydown:arrow` events on the controller. * - * @fires wp.media.controller.MediaLibrary#attachment:details:shift-tab - * @fires wp.media.controller.MediaLibrary#attachment:keydown:arrow + * @since 4.0.0 * * @param {KeyboardEvent} event A keyboard event. * From 5303c3c7b337959ee42e53b50febee0fff101145 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 16:52:41 +0200 Subject: [PATCH 15/23] Fix valid types in media views attachments.js file. --- src/js/media/views/attachments.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/js/media/views/attachments.js b/src/js/media/views/attachments.js index a4712eab01497..126fc2476c0de 100644 --- a/src/js/media/views/attachments.js +++ b/src/js/media/views/attachments.js @@ -25,13 +25,13 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{ * * @augments wp.media.View * - * @listens collection:add - * @listens collection:remove - * @listens collection:reset - * @listens controller:library:selection:add - * @listens scrollElement:scroll - * @listens this:ready - * @listens controller:open + * @listens collection#add + * @listens collection#remove + * @listens collection#reset + * @listens controller#library#selection#add + * @listens scrollElement#scroll + * @listens this#ready + * @listens controller#open */ initialize: function() { this.el.id = _.uniqueId('__attachments-view-'); @@ -123,7 +123,7 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{ * * @since 4.0.0 * - * @listens window:resize + * @listens window#resize * * @return {void} */ @@ -269,9 +269,9 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{ * Fails gracefully if jQuery sortable doesn't exist or isn't passed * in the options. * - * @since 3.5.0 + * Fires `collection:reset`. * - * @fires collection:reset + * @since 3.5.0 * * @return {void} */ From 30d269c6d7c872f972153eb1ef8a0cbb6dbf7b9e Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 17:00:14 +0200 Subject: [PATCH 16/23] Fix valid types in media views frame manage.js file. --- src/js/media/views/frame/manage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/media/views/frame/manage.js b/src/js/media/views/frame/manage.js index 9a68051fb9b3a..e619a94f6d49c 100644 --- a/src/js/media/views/frame/manage.js +++ b/src/js/media/views/frame/manage.js @@ -251,7 +251,7 @@ Manage = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Manage.prototype * * @param {Object} contentRegion Basic object with a `view` property, which * should be set with the proper region view. - * @this wp.media.controller.Region + * @this {wp.media.controller.Region} */ browseContent: function( contentRegion ) { var state = this.state(); From d93c35926e2b64dc1614f266986f8b37f596e384 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 17:01:15 +0200 Subject: [PATCH 17/23] Fix valid types in media views frame select.js file. --- src/js/media/views/frame/select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/media/views/frame/select.js b/src/js/media/views/frame/select.js index f736aa33be2a2..38b91c31b5fea 100644 --- a/src/js/media/views/frame/select.js +++ b/src/js/media/views/frame/select.js @@ -169,7 +169,7 @@ Select = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Select.prototype * * @param {Object} toolbar The toolbar object for the `select` mode. * @param {Object} [options={}] The options for creating the select toolbar view. - * @this wp.media.controller.Region + * @this {wp.media.controller.Region} */ createSelectToolbar: function( toolbar, options ) { options = options || this.options.button || {}; From f7cfcde740a8fda021cbbfa885a09e57a41a5e6c Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 17:03:59 +0200 Subject: [PATCH 18/23] Remove invalid event notation in media views frame.js file. --- src/js/media/views/frame.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/js/media/views/frame.js b/src/js/media/views/frame.js index 3bbf47c7f8bb1..2e2145ba969ca 100644 --- a/src/js/media/views/frame.js +++ b/src/js/media/views/frame.js @@ -144,11 +144,8 @@ var Frame = wp.media.View.extend(/** @lends wp.media.view.Frame.prototype */{ } this.activeModes.remove( this.activeModes.where( { id: mode } ) ); this.$el.removeClass( 'mode-' + mode ); - /** - * Frame mode deactivation event. - * - * @event wp.media.view.Frame#{mode}:deactivate - */ + + // Fires a `#{mode}:deactivate` event on the frame. this.trigger( mode + ':deactivate' ); return this; From 8c053ec0178d7fa687c79abaea99d7be5d868c05 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 17:07:02 +0200 Subject: [PATCH 19/23] Remove invalid fires notations in media views media-details.js file. --- src/js/media/views/media-details.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/media/views/media-details.js b/src/js/media/views/media-details.js index 02286a55617bd..5fdeb64a05cd1 100644 --- a/src/js/media/views/media-details.js +++ b/src/js/media/views/media-details.js @@ -59,7 +59,7 @@ MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.pr /** * Removes a setting's UI when the model unsets it * - * @fires wp.media.view.MediaDetails#media:setting:remove + * Fires `wp.media.view.MediaDetails#media:setting:remove` when a setting is removed. * * @param {JQuery.Event} e The jQuery event object. */ @@ -78,7 +78,7 @@ MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.pr /** * Sets the tracks for the media details view. * - * @fires wp.media.view.MediaDetails#media:setting:remove + * Fires `wp.media.view.MediaDetails#media:setting:remove` when the tracks are updated. */ setTracks : function() { var tracks = ''; From 06b521145198b5467b7ca3392f75d6bb69bcfe35 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 17:08:30 +0200 Subject: [PATCH 20/23] Fix valid types in media views media-frame.js file. --- src/js/media/views/media-frame.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/media/views/media-frame.js b/src/js/media/views/media-frame.js index 4cc645ff908fd..9d99f3a5e81a9 100644 --- a/src/js/media/views/media-frame.js +++ b/src/js/media/views/media-frame.js @@ -161,7 +161,7 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{ * Creates the title view. * * @param {Object} title The title object for creating the title view. - * @this wp.media.controller.Region + * @this {wp.media.controller.Region} */ createTitle: function( title ) { // A modal's dialog element points `aria-labelledby` at its frame heading. @@ -175,7 +175,7 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{ * Creates the menu view. * * @param {Object} menu The menu object for creating the menu view. - * @this wp.media.controller.Region + * @this {wp.media.controller.Region} */ createMenu: function( menu ) { menu.view = new wp.media.view.Menu({ @@ -206,7 +206,7 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{ * Creates the toolbar view. * * @param {Object} toolbar The toolbar object for creating the toolbar view. - * @this wp.media.controller.Region + * @this {wp.media.controller.Region} */ createToolbar: function( toolbar ) { toolbar.view = new wp.media.view.Toolbar({ @@ -217,7 +217,7 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{ * Creates the router view. * * @param {Object} router The router object for creating the router view. - * @this wp.media.controller.Region + * @this {wp.media.controller.Region} */ createRouter: function( router ) { router.view = new wp.media.view.Router({ @@ -274,7 +274,7 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{ * Creates the iframe content view. * * @param {Object} content The content object for creating the iframe content view. - * @this wp.media.controller.Region + * @this {wp.media.controller.Region} */ iframeContent: function( content ) { this.$el.addClass('hide-toolbar'); From 1201c48a786a80585464988ddb524098eac41102 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 17:15:25 +0200 Subject: [PATCH 21/23] Fix wp api.js file. --- src/js/_enqueues/wp/api.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/_enqueues/wp/api.js b/src/js/_enqueues/wp/api.js index a4e5c468ee64f..4790b38b0cd79 100644 --- a/src/js/_enqueues/wp/api.js +++ b/src/js/_enqueues/wp/api.js @@ -874,7 +874,9 @@ * @return {*}. */ sync: function( method, model, options ) { - var Object; options = options || {}; + var beforeSend; + + options = options || {}; // Remove date_gmt if null. if ( _.isNull( model.get( 'date_gmt' ) ) ) { From 373de73ed3120c96f64fceb71c2cce8d3ce57045 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 17:47:36 +0200 Subject: [PATCH 22/23] Use prose description instead of changing listens notations meaning. --- src/js/media/views/attachments.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/js/media/views/attachments.js b/src/js/media/views/attachments.js index 126fc2476c0de..7122463722323 100644 --- a/src/js/media/views/attachments.js +++ b/src/js/media/views/attachments.js @@ -18,20 +18,16 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{ * The constructor binds events to the collection this view represents when * adding or removing attachments or resetting the entire collection. * + * Listens for `collection:add`, `collection:remove`, `collection:reset`, + * `controller:library:selection:add`, `scrollElement:scroll`, `this:ready`, + * and `controller:open` events. + * * @since 3.5.0 * * @constructs * @memberof wp.media.view * * @augments wp.media.View - * - * @listens collection#add - * @listens collection#remove - * @listens collection#reset - * @listens controller#library#selection#add - * @listens scrollElement#scroll - * @listens this#ready - * @listens controller#open */ initialize: function() { this.el.id = _.uniqueId('__attachments-view-'); @@ -121,9 +117,9 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{ * Adjusts the amount of columns accordingly. First removes any existing event * handlers to prevent duplicate listeners. * - * @since 4.0.0 + * Listens for the `window:resize` event. * - * @listens window#resize + * @since 4.0.0 * * @return {void} */ From 43e5ea5dafef1602c9b9d9d5366b3f896dc167d2 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 20 Sep 2026 17:59:22 +0200 Subject: [PATCH 23/23] Improve wp api.hs more function return notation. --- src/js/_enqueues/wp/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/wp/api.js b/src/js/_enqueues/wp/api.js index 4790b38b0cd79..4584d0f8b17d6 100644 --- a/src/js/_enqueues/wp/api.js +++ b/src/js/_enqueues/wp/api.js @@ -1110,7 +1110,7 @@ * * @param {Object} [options] An object containing the page number to fetch. If not provided, the next page will be fetched. * @param {number} [options.data.page] The page number to fetch. - * @return {*} The result of the fetch operation. + * @return {JQuery.Promise} A promise that resolves when the fetch operation completes. */ more: function( options ) { options = options || {};