Build/Test Tools: Enable JSDocs to be linted with ESLint.

As part of the [Javascript Inline Docs Initiative](https://make.wordpress.org/core/handbook/docs/inline/js/) this add some tooling to lint Javascript docblocks. Two new commands:

* `npm run lint:jsdoc`
* `npm run lint:jsdoc:fix`

The latter will run the linter and try to fix an possible issues automatically.

Fixes #43828.
Props netweb, atimmer, kamataryo, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48650 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jake Spurlock 2020-07-27 23:33:51 +00:00
parent a1a1173250
commit 9ed92faaca
46 changed files with 394 additions and 348 deletions

15
.eslintignore Normal file
View File

@ -0,0 +1,15 @@
# Files and folders related to build/test tools
/build
/node_modules
/tests
/vendor
/tools
# Excluded files and folders based on `jsdoc.conf.json` exclusions
/src/js/_enqueues/vendor
# Webpack built files
/src/wp-includes/js/media-*
# Themes
src/wp-content/themes/

29
.eslintrc-jsdoc.js Normal file
View File

@ -0,0 +1,29 @@
module.exports = {
rules: {
'require-jsdoc': 'off',
'valid-jsdoc': [ 'error', {
prefer: {
arg: 'param',
argument: 'param',
extends: 'augments',
returns: 'return',
},
preferType: {
array: 'Array',
bool: 'boolean',
Boolean: 'boolean',
float: 'number',
Float: 'number',
int: 'number',
integer: 'number',
Integer: 'number',
Number: 'number',
object: 'Object',
String: 'string',
Void: 'void',
},
requireParamDescription: false,
requireReturn: false,
} ],
},
};

View File

@ -155,6 +155,8 @@
"test": "grunt test",
"watch": "grunt watch",
"grunt": "grunt",
"lint:jsdoc": "wp-scripts lint-js",
"lint:jsdoc:fix": "wp-scripts lint-js --fix",
"env:start": "node ./tools/local-env/scripts/start.js",
"env:stop": "node ./tools/local-env/scripts/docker.js down",
"env:restart": "npm run env:stop && npm run env:start",

View File

@ -137,7 +137,7 @@ window.columns = {
*
* @since 3.1.0
*
* @param {int} diff The modifier for the column span.
* @param {number} diff The modifier for the column span.
*/
colSpanChange : function(diff) {
var $t = $('table').find('.colspanchange'), n;
@ -384,7 +384,7 @@ $permalinkStructure.on( 'focus', function( event ) {
* If the structure is already used in the custom permalink structure,
* it will be disabled.
*
* @param {object} button Button jQuery object.
* @param {Object} button Button jQuery object.
*/
function changeStructureTagButtonState( button ) {
if ( -1 !== $permalinkStructure.val().indexOf( button.text().trim() ) ) {

View File

@ -159,7 +159,7 @@ var getCount, updateCount, updateCountText, updatePending, updateApproved,
*
* @since 5.2.0
*
* @param {object} response Ajax response from the server that includes a
* @param {Object} response Ajax response from the server that includes a
* translated "comments in moderation" message.
*
* @return {void}

View File

@ -389,7 +389,7 @@ window.wp = window.wp || {};
*
* @since 2.7.0
*
* @param {int} id The ID for the post that has been changed.
* @param {number} id The ID for the post that has been changed.
* @return {boolean} False, so the form does not submit when pressing
* Enter on a focused field.
*/

View File

@ -34,8 +34,8 @@ window.wp = window.wp || {};
*
* @memberof commentsBox
*
* @param {int} total Total number of comments for this post.
* @param {int} num Optional. Number of comments to fetch, defaults to 20.
* @param {number} total Total number of comments for this post.
* @param {number} num Optional. Number of comments to fetch, defaults to 20.
* @return {boolean} Always returns false.
*/
get : function(total, num) {
@ -94,7 +94,7 @@ window.wp = window.wp || {};
*
* @memberof commentsBox
*
* @param {int} total Total number of comments to load.
* @param {number} total Total number of comments to load.
*/
load: function(total){
this.st = jQuery('#the-comment-list tr.comment:visible').length;
@ -116,7 +116,7 @@ window.wp = window.wp || {};
/**
* Set the Image ID of the Featured Image
*
* @param {int} id The post_id of the image to use as Featured Image.
* @param {number} id The post_id of the image to use as Featured Image.
*
* @global
*/

View File

@ -154,8 +154,8 @@
* @since 5.5.0
*
* @param {string} position The "previous" or "next" sortables area.
* @param {object} button The jQuery object representing the button that was clicked.
* @param {object} postbox The jQuery object representing the postbox to be moved.
* @param {Object} button The jQuery object representing the button that was clicked.
* @param {Object} postbox The jQuery object representing the postbox to be moved.
*
* @return {void}
*/

View File

@ -30,8 +30,8 @@
*
* @since 4.7.0
*
* @param {object} options Options that are passed to UI Autocomplete. Can be used to override the default settings.
* @return {object} jQuery instance.
* @param {Object} options Options that are passed to UI Autocomplete. Can be used to override the default settings.
* @return {Object} jQuery instance.
*/
$.fn.wpTagsSuggest = function( options ) {
var cache;

View File

@ -234,7 +234,7 @@ window.wpWidgets = {
*
* @ignore
*
* @param {object} event jQuery event object.
* @param {Object} event jQuery event object.
*/
over: function( event ) {
var $wrap = $( event.target ).parent();
@ -259,7 +259,7 @@ window.wpWidgets = {
*
* @ignore
*
* @param {object} event jQuery event object.
* @param {Object} event jQuery event object.
*/
out: function( event ) {
if ( wpWidgets.hoveredSidebar ) {
@ -729,7 +729,7 @@ window.wpWidgets = {
*
* Used when a Widget gets dragged in/out of the Sidebar and never dropped.
*
* @param {object} event jQuery event object.
* @param {Object} event jQuery event object.
*/
closeSidebar: function( event ) {
this.hoveredSidebar

View File

@ -294,8 +294,8 @@
* @since 5.3.1
*
* @param {HTMLElement} element The HTML element.
* @param {String} className The class name.
* @return {bool} Whether the element has the className.
* @param {string} className The class name.
* @return {boolean} Whether the element has the className.
*/
function hasClass( element, className ) {
var classNames;
@ -320,7 +320,7 @@
* @since 5.3.1
*
* @param {HTMLElement} element The HTML element.
* @param {String} className The class name.
* @param {string} className The class name.
*/
function addClass( element, className ) {
if ( ! element ) {
@ -344,7 +344,7 @@
* @since 5.3.1
*
* @param {HTMLElement} element The HTML element.
* @param {String} className The class name.
* @param {string} className The class name.
*/
function removeClass( element, className ) {
var testName,

View File

@ -265,9 +265,9 @@ window.addComment = ( function( window ) {
* @since 5.1.0
*
* @param {HTMLElement} Element DOM element with the attribute.
* @param {String} Attribute the attribute to get.
* @param {string} Attribute the attribute to get.
*
* @return {String}
* @return {string}
*/
function getDataAttribute( element, attribute ) {
if ( supportsDataset ) {
@ -298,11 +298,11 @@ window.addComment = ( function( window ) {
*
* @memberOf addComment
*
* @param {String} addBelowId HTML ID of element the form follows.
* @param {String} commentId Database ID of comment being replied to.
* @param {String} respondId HTML ID of 'respond' element.
* @param {String} postId Database ID of the post.
* @param {String} replyTo Form heading content.
* @param {string} addBelowId HTML ID of element the form follows.
* @param {string} commentId Database ID of comment being replied to.
* @param {string} respondId HTML ID of 'respond' element.
* @param {string} postId Database ID of the post.
* @param {string} replyTo Form heading content.
*/
function moveForm( addBelowId, commentId, respondId, postId, replyTo ) {
// Get elements based on their IDs.

View File

@ -73,7 +73,7 @@
* @memberof imageEdit
*
* @param {jQuery} el The element that should be modified.
* @param {bool|number} s The state for the element. If set to true
* @param {boolean|number} s The state for the element. If set to true
* the element is disabled,
* otherwise the element is enabled.
* The function is sometimes called with a 0 or 1
@ -577,7 +577,7 @@
*
* @param {number} postid The post ID for the image.
* @param {string} nonce The nonce to verify the request.
* @param {object} view The image editor view to be used for the editing.
* @param {Object} view The image editor view to be used for the editing.
*
* @return {void|promise} Either returns void if the button was already activated
* or returns an instance of the image editor, wrapped in a promise.
@ -774,10 +774,10 @@
*
* @ignore
*
* @param {object} img jQuery object representing the image.
* @param {object} c The selection.
* @param {Object} img jQuery object representing the image.
* @param {Object} c The selection.
*
* @return {object}
* @return {Object}
*/
onSelectEnd: function(img, c) {
imageEdit.setCropSelection(postid, c);
@ -788,8 +788,8 @@
*
* @ignore
*
* @param {object} img jQuery object representing the image.
* @param {object} c The selection.
* @param {Object} img jQuery object representing the image.
* @param {Object} c The selection.
*
* @return {void}
*/
@ -809,7 +809,7 @@
* @memberof imageEdit
*
* @param {number} postid The post ID.
* @param {object} c The selection.
* @param {Object} c The selection.
*
* @return {boolean}
*/
@ -841,9 +841,9 @@
* @memberof imageEdit
*
* @param {number} postid The post ID.
* @param {bool} warn Warning message.
* @param {boolean} warn Warning message.
*
* @return {void|bool} Returns false if there is a warning.
* @return {void|boolean} Returns false if there is a warning.
*/
close : function(postid, warn) {
warn = warn || false;
@ -908,7 +908,7 @@
*
* @memberof imageEdit
*
* @param {object} op The original position.
* @param {Object} op The original position.
* @param {number} postid The post ID.
* @param {string} nonce The nonce.
*
@ -945,7 +945,7 @@
* @param {string} angle The angle the image is rotated with.
* @param {number} postid The post ID.
* @param {string} nonce The nonce.
* @param {object} t The target element.
* @param {Object} t The target element.
*
* @return {boolean}
*/
@ -967,7 +967,7 @@
* @param {number} axis The axle the image is flipped on.
* @param {number} postid The post ID.
* @param {string} nonce The nonce.
* @param {object} t The target element.
* @param {Object} t The target element.
*
* @return {boolean}
*/
@ -988,7 +988,7 @@
*
* @param {number} postid The post ID.
* @param {string} nonce The nonce.
* @param {object} t The target object.
* @param {Object} t The target object.
*
* @return {void|boolean} Returns false if the crop button is disabled.
*/

View File

@ -202,7 +202,7 @@ wpList = {
* 6. 0 if none can be found.
*
* @param {jQuery} element Element that triggered the request.
* @param {object} settings Settings for the Ajax request.
* @param {Object} settings Settings for the Ajax request.
* @return {string|number} Nonce
*/
nonce: function( element, settings ) {
@ -258,9 +258,9 @@ wpList = {
* Calls a confirm callback to verify the action that is about to be performed.
*
* @param {HTMLElement} list The DOM element.
* @param {object} settings Settings for this list.
* @param {Object} settings Settings for this list.
* @param {string} action The type of action to perform: 'add', 'delete', or 'dim'.
* @return {object|boolean} Settings if confirmed, false if not.
* @return {Object|boolean} Settings if confirmed, false if not.
*/
pre: function( list, settings, action ) {
var $element, backgroundColor, confirmed;
@ -297,7 +297,7 @@ wpList = {
* Adds an item to the list via Ajax.
*
* @param {HTMLElement} element The DOM element.
* @param {object} settings Settings for this list.
* @param {Object} settings Settings for this list.
* @return {boolean} Whether the item was added.
*/
ajaxAdd: function( element, settings ) {
@ -399,7 +399,7 @@ wpList = {
* Delete an item in the list via Ajax.
*
* @param {HTMLElement} element A DOM element containing item data.
* @param {object} settings Settings for this list.
* @param {Object} settings Settings for this list.
* @return {boolean} Whether the item was deleted.
*/
ajaxDel: function( element, settings ) {
@ -486,7 +486,7 @@ wpList = {
* Dim an item in the list via Ajax.
*
* @param {HTMLElement} element A DOM element containing item data.
* @param {object} settings Settings for this list.
* @param {Object} settings Settings for this list.
* @return {boolean} Whether the item was dim'ed.
*/
ajaxDim: function( element, settings ) {
@ -621,7 +621,7 @@ wpList = {
* Adds something.
*
* @param {HTMLElement} element A DOM element containing item data.
* @param {object} settings Settings for this list.
* @param {Object} settings Settings for this list.
* @return {boolean} Whether the item was added.
*/
add: function( element, settings ) {

View File

@ -429,7 +429,7 @@
* Refreshes advanced accessibility buttons for one menu item.
* Shows or hides buttons based on the location of the menu item.
*
* @param {object} itemToRefresh The menu item that might need its advanced accessibility buttons refreshed
* @param {Object} itemToRefresh The menu item that might need its advanced accessibility buttons refreshed
*/
refreshAdvancedAccessibilityOfItem : function( itemToRefresh ) {
@ -1293,7 +1293,7 @@
/**
* Remove a menu item.
*
* @param {object} el The element to be removed as a jQuery object.
* @param {Object} el The element to be removed as a jQuery object.
*
* @fires document#menu-removing-item Passes the element to be removed.
*/

View File

@ -18,8 +18,8 @@ window.wp = window.wp || {};
* @since 4.2.0
* @since 4.3.0 Introduced the 'ariaLive' argument.
*
* @param {String} message The message to be announced by Assistive Technologies.
* @param {String} [ariaLive] The politeness level for aria-live. Possible values:
* @param {string} message The message to be announced by Assistive Technologies.
* @param {string} [ariaLive] The politeness level for aria-live. Possible values:
* polite or assertive. Default polite.
* @return {void}
*/
@ -53,7 +53,7 @@ window.wp = window.wp || {};
*
* @since 4.3.0
*
* @param {String} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.
* @param {string} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.
*
* @return {Object} $container The ARIA live region jQuery object.
*/

View File

@ -186,7 +186,7 @@
* Extract a route part based on negative index.
*
* @param {string} route The endpoint route.
* @param {int} part The number of parts from the end of the route to retrieve. Default 1.
* @param {number} part The number of parts from the end of the route to retrieve. Default 1.
* Example route `/a/b/c`: part 1 is `c`, part 2 is `b`, part 3 is `a`.
* @param {string} [versionString] Version string, defaults to `wp.api.versionString`.
* @param {boolean} [reverse] Whether to reverse the order when extracting the route part. Optional, default false.
@ -234,7 +234,7 @@
/**
* Add args and options to a model prototype from a route's endpoints.
*
* @param {array} routeEndpoints Array of route endpoints.
* @param {Array} routeEndpoints Array of route endpoints.
* @param {Object} modelInstance An instance of the model (or collection)
* to add the args to.
*/
@ -361,7 +361,7 @@
* Build a helper function to retrieve related model.
*
* @param {string} parentModel The parent model.
* @param {int} modelId The model ID if the object to request
* @param {number} modelId The model ID if the object to request
* @param {string} modelName The model name to use when constructing the model.
* @param {string} embedSourcePoint Where to check the embedds object for _embed data.
* @param {string} embedCheckField Which model field to check to see if the model has data.
@ -513,7 +513,7 @@
*
* @param {string} key The meta key.
*
* @return {object} The post meta value.
* @return {Object} The post meta value.
*/
getMeta: function( key ) {
var metas = this.get( 'meta' );
@ -523,7 +523,7 @@
/**
* Get all meta key/values for a post.
*
* @return {object} The post metas, as a key value pair object.
* @return {Object} The post metas, as a key value pair object.
*/
getMetas: function() {
return this.get( 'meta' );
@ -532,7 +532,7 @@
/**
* Set a group of meta key/values for a post.
*
* @param {object} meta The post meta to set, as key/value pairs.
* @param {Object} meta The post meta to set, as key/value pairs.
*/
setMetas: function( meta ) {
var metas = this.get( 'meta' );
@ -544,7 +544,7 @@
* Set a single meta value for a post, by key.
*
* @param {string} key The meta key.
* @param {object} value The meta value.
* @param {Object} value The meta value.
*/
setMeta: function( key, value ) {
var metas = this.get( 'meta' );
@ -589,7 +589,7 @@
*
* Accepts an array of tag slugs, or a Tags collection.
*
* @param {array|Backbone.Collection} tags The tags to set on the post.
* @param {Array|Backbone.Collection} tags The tags to set on the post.
*
*/
setTags: function( tags ) {
@ -635,7 +635,7 @@
*
* Accepts a Tags collection.
*
* @param {array|Backbone.Collection} tags The tags to set on the post.
* @param {Array|Backbone.Collection} tags The tags to set on the post.
*
*/
setTagsWithCollection: function( tags ) {
@ -673,7 +673,7 @@
*
* Accepts an array of category slugs, or a Categories collection.
*
* @param {array|Backbone.Collection} categories The categories to set on the post.
* @param {Array|Backbone.Collection} categories The categories to set on the post.
*
*/
setCategories: function( categories ) {
@ -720,7 +720,7 @@
*
* Accepts Categories collection.
*
* @param {array|Backbone.Collection} categories The categories to set on the post.
* @param {Array|Backbone.Collection} categories The categories to set on the post.
*
*/
setCategoriesWithCollection: function( categories ) {
@ -1495,11 +1495,11 @@
/**
* Initialize the wp-api, optionally passing the API root.
*
* @param {object} [args]
* @param {Object} [args]
* @param {string} [args.nonce] The nonce. Optional, defaults to wpApiSettings.nonce.
* @param {string} [args.apiRoot] The api root. Optional, defaults to wpApiSettings.root.
* @param {string} [args.versionString] The version string. Optional, defaults to wpApiSettings.root.
* @param {object} [args.schema] The schema. Optional, will be fetched from API if not provided.
* @param {Object} [args.schema] The schema. Optional, will be fetched from API if not provided.
*/
wp.api.init = function( args ) {
var endpoint, attributes = {}, deferred, promise;

View File

@ -39,8 +39,8 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
* Configure linting.
*
* @param {CodeMirror} editor - Editor.
* @param {object} settings - Code editor settings.
* @param {object} settings.codeMirror - Settings for CodeMirror.
* @param {Object} settings - Code editor settings.
* @param {Object} settings.codeMirror - Settings for CodeMirror.
* @param {Function} settings.onChangeLintingErrors - Callback for when there are changes to linting errors.
* @param {Function} settings.onUpdateErrorNotice - Callback to update error notice.
*
@ -64,7 +64,7 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
/**
* Get lint options.
*
* @return {object} Lint options.
* @return {Object} Lint options.
*/
function getLintOptions() { // eslint-disable-line complexity
var options = editor.getOption( 'lint' );
@ -213,8 +213,8 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
* Configure tabbing.
*
* @param {CodeMirror} codemirror - Editor.
* @param {object} settings - Code editor settings.
* @param {object} settings.codeMirror - Settings for CodeMirror.
* @param {Object} settings - Code editor settings.
* @param {Object} settings.codeMirror - Settings for CodeMirror.
* @param {Function} settings.onTabNext - Callback to handle tabbing to the next tabbable element.
* @param {Function} settings.onTabPrevious - Callback to handle tabbing to the previous tabbable element.
*
@ -267,15 +267,15 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
* @since 4.9.0
*
* @param {string|jQuery|Element} textarea - The HTML id, jQuery object, or DOM Element for the textarea that is used for the editor.
* @param {object} [settings] - Settings to override defaults.
* @param {Object} [settings] - Settings to override defaults.
* @param {Function} [settings.onChangeLintingErrors] - Callback for when the linting errors have changed.
* @param {Function} [settings.onUpdateErrorNotice] - Callback for when error notice should be displayed.
* @param {Function} [settings.onTabPrevious] - Callback to handle tabbing to the previous tabbable element.
* @param {Function} [settings.onTabNext] - Callback to handle tabbing to the next tabbable element.
* @param {object} [settings.codemirror] - Options for CodeMirror.
* @param {object} [settings.csslint] - Rules for CSSLint.
* @param {object} [settings.htmlhint] - Rules for HTMLHint.
* @param {object} [settings.jshint] - Rules for JSHint.
* @param {Object} [settings.codemirror] - Options for CodeMirror.
* @param {Object} [settings.csslint] - Rules for CSSLint.
* @param {Object} [settings.htmlhint] - Rules for HTMLHint.
* @param {Object} [settings.jshint] - Rules for JSHint.
*
* @return {CodeEditorInstance} Instance.
*/

View File

@ -108,7 +108,7 @@
/**
* Initialize the video handler.
*
* @param {object} settings Video settings.
* @param {Object} settings Video settings.
*/
initialize: function( settings ) {
var handler = this,
@ -217,7 +217,7 @@
* Whether the handler can process a video.
*
* @abstract
* @param {object} settings Video settings.
* @param {Object} settings Video settings.
* @return {boolean}
*/
test: function() {
@ -239,7 +239,7 @@
*
* @memberOf wp
*
* @param {object} protoProps Properties to apply to the prototype.
* @param {Object} protoProps Properties to apply to the prototype.
* @return CustomHandler The subclass.
*/
BaseHandler.extend = function( protoProps ) {
@ -271,7 +271,7 @@
/**
* Whether the native handler supports a video.
*
* @param {object} settings Video settings.
* @param {Object} settings Video settings.
* @return {boolean}
*/
test: function( settings ) {
@ -345,7 +345,7 @@
/**
* Whether the handler supports a video.
*
* @param {object} settings Video settings.
* @param {Object} settings Video settings.
* @return {boolean}
*/
test: function( settings ) {

View File

@ -188,7 +188,7 @@ window.wp = window.wp || {};
api.Value = api.Class.extend(/** @lends wp.customize.Value.prototype */{
/**
* @param {mixed} initial The initial value.
* @param {object} options
* @param {Object} options
*/
initialize: function( initial, options ) {
this._value = initial; // @todo Potentially change this to a this.set() call.
@ -220,7 +220,7 @@ window.wp = window.wp || {};
/**
* Set the value and trigger all bound callbacks.
*
* @param {object} to New value.
* @param {Object} to New value.
*/
set: function( to ) {
var from = this._value;
@ -382,7 +382,7 @@ window.wp = window.wp || {};
* Whether the collection has an item with the given ID.
*
* @param {string} id The ID of the item to look for.
* @return {Boolean}
* @return {boolean}
*/
has: function( id ) {
return typeof this._value[ id ] !== 'undefined';
@ -447,7 +447,7 @@ window.wp = window.wp || {};
* Iterate over all items in the collection invoking the provided callback.
*
* @param {Function} callback Function to invoke.
* @param {object} context Object context to invoke the function with. Optional.
* @param {Object} context Object context to invoke the function with. Optional.
*/
each: function( callback, context ) {
context = typeof context === 'undefined' ? this : context;
@ -682,11 +682,11 @@ window.wp = window.wp || {};
/**
* Initialize Messenger.
*
* @param {object} params - Parameters to configure the messenger.
* @param {Object} params - Parameters to configure the messenger.
* {string} params.url - The URL to communicate with.
* {window} params.targetWindow - The window instance to communicate with. Default window.parent.
* {string} params.channel - If provided, will send the channel with each message and only accept messages a matching channel.
* @param {object} options - Extend any instance parameter or method with this object.
* @param {Object} options - Extend any instance parameter or method with this object.
*/
initialize: function( params, options ) {
// Target the parent frame by default, but only if a parent frame exists.
@ -787,7 +787,7 @@ window.wp = window.wp || {};
* Send data to the other window.
*
* @param {string} id The event name.
* @param {object} data Data.
* @param {Object} data Data.
*/
send: function( id, data ) {
var message;
@ -862,7 +862,7 @@ window.wp = window.wp || {};
* @since 4.9.0
*
* @param {string} code - Notification code.
* @param {object} params - Notification parameters.
* @param {Object} params - Notification parameters.
* @param {string} params.message - Message.
* @param {string} [params.type=error] - Type.
* @param {string} [params.setting] - Related setting ID.
@ -934,7 +934,7 @@ window.wp = window.wp || {};
*
* @alias wp.customize.get
*
* @return {object}
* @return {Object}
*/
api.get = function() {
var result = {};
@ -962,7 +962,7 @@ window.wp = window.wp || {};
* @alias wp.customize.utils.parseQueryString
*
* @param {string} queryString Query string.
* @return {object} Parsed query string.
* @return {Object} Parsed query string.
*/
api.utils.parseQueryString = function parseQueryString( queryString ) {
var queryParams = {};

View File

@ -25,7 +25,7 @@
* @since 4.9.0
*
* @param {string} code - Code.
* @param {object} params - Params.
* @param {Object} params - Params.
*/
initialize: function( code, params ) {
var notification = this;
@ -94,7 +94,7 @@
* @constructs wp.customize.Notifications
* @augments wp.customize.Values
*
* @param {object} options - Options.
* @param {Object} options - Options.
* @param {jQuery} [options.container] - Container element for notifications. This can be injected later.
* @param {boolean} [options.alt] - Whether alternative style should be used when rendering notifications.
*
@ -174,7 +174,7 @@
* Notifications may be sorted by type followed by added time.
*
* @since 4.9.0
* @param {object} args - Args.
* @param {Object} args - Args.
* @param {boolean} [args.sort=false] - Whether to return the notifications sorted.
* @return {Array.<wp.customize.Notification>} Notifications.
*/
@ -362,10 +362,10 @@
*
* @param {string} id - The setting ID.
* @param {*} value - The initial value of the setting.
* @param {object} [options={}] - Options.
* @param {Object} [options={}] - Options.
* @param {string} [options.transport=refresh] - The transport to use for previewing. Supports 'refresh' and 'postMessage'.
* @param {boolean} [options.dirty=false] - Whether the setting should be considered initially dirty.
* @param {object} [options.previewer] - The Previewer instance to sync with. Defaults to wp.customize.previewer.
* @param {Object} [options.previewer] - The Previewer instance to sync with. Defaults to wp.customize.previewer.
*/
initialize: function( id, value, options ) {
var setting = this, params;
@ -495,9 +495,9 @@
* @since 4.7.0
* @access public
*
* @param {object} [options] Options.
* @param {Object} [options] Options.
* @param {boolean} [options.unsaved=false] Whether only values not saved yet into a changeset will be returned (differential changes).
* @return {object} Dirty setting values.
* @return {Object} Dirty setting values.
*/
api.dirtyValues = function dirtyValues( options ) {
var values = {};
@ -528,9 +528,9 @@
* @since 4.7.0
* @access public
*
* @param {object} [changes] - Mapping of setting IDs to setting params each normally including a value property, or mapping to null.
* @param {Object} [changes] - Mapping of setting IDs to setting params each normally including a value property, or mapping to null.
* If not provided, then the changes will still be obtained from unsaved dirty settings.
* @param {object} [args] - Additional options for the save request.
* @param {Object} [args] - Additional options for the save request.
* @param {boolean} [args.autosave=false] - Whether changes will be stored in autosave revision if the changeset has been promoted from an auto-draft.
* @param {boolean} [args.force=false] - Send request to update even when there are no changes to submit. This can be used to request the latest status of the changeset on the server.
* @param {string} [args.title] - Title to update in the changeset. Optional.
@ -736,7 +736,7 @@
*
* @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} a
* @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} b
* @return {Number}
* @return {number}
*/
api.utils.prioritySort = function ( a, b ) {
if ( a.priority() === b.priority() && typeof a.params.instanceNumber === 'number' && typeof b.params.instanceNumber === 'number' ) {
@ -796,7 +796,7 @@
* @since 4.9.0
*
* @param {jQuery} button - The element to highlight.
* @param {object} [options] - Options.
* @param {Object} [options] - Options.
* @param {number} [options.delay=0] - Delay in milliseconds.
* @param {jQuery} [options.focusTarget] - A target for user focus that defaults to the highlighted element.
* If the user focuses the target before the delay passes, the reminder
@ -850,7 +850,7 @@
*
* @since 4.9.0
*
* @return {int} Current timestamp.
* @return {number} Current timestamp.
*/
api.utils.getCurrentTimestamp = function getCurrentTimestamp() {
var currentDate, currentClientTimestamp, timestampDifferential;
@ -869,8 +869,8 @@
*
* @since 4.9.0
*
* @param {string|int|Date} datetime - Date time or timestamp of the future date.
* @return {int} remainingTime - Remaining time in milliseconds.
* @param {string|number|Date} datetime - Date time or timestamp of the future date.
* @return {number} remainingTime - Remaining time in milliseconds.
*/
api.utils.getRemainingTime = function getRemainingTime( datetime ) {
var millisecondsDivider = 1000, remainingTime, timestamp;
@ -940,7 +940,7 @@
* @borrows wp.customize~focus as focus
*
* @param {string} id - The ID for the container.
* @param {object} options - Object containing one property: params.
* @param {Object} options - Object containing one property: params.
* @param {string} options.title - Title shown when panel is collapsed and expanded.
* @param {string} [options.description] - Description shown at the top of the panel.
* @param {number} [options.priority=100] - The sort priority for the panel.
@ -948,7 +948,7 @@
* @param {string} [options.type=default] - The type of the panel. See wp.customize.panelConstructor.
* @param {string} [options.content] - The markup to be used for the panel container. If empty, a JS template is used.
* @param {boolean} [options.active=true] - Whether the panel is active or not.
* @param {object} [options.params] - Deprecated wrapper for the above properties.
* @param {Object} [options.params] - Deprecated wrapper for the above properties.
*/
initialize: function ( id, options ) {
var container = this;
@ -1055,8 +1055,8 @@
*
* @since 4.1.0
*
* @param {String} parentType
* @param {String} childType
* @param {string} parentType
* @param {string} childType
* @return {Array}
*/
_children: function ( parentType, childType ) {
@ -1154,9 +1154,9 @@
/**
* @since 4.1.0
*
* @param {Boolean} active
* @param {boolean} active
* @param {Object} [params]
* @return {Boolean} False if state already applied.
* @return {boolean} False if state already applied.
*/
_toggleActive: function ( active, params ) {
var self = this;
@ -1175,7 +1175,7 @@
/**
* @param {Object} [params]
* @return {Boolean} False if already active.
* @return {boolean} False if already active.
*/
activate: function ( params ) {
return this._toggleActive( true, params );
@ -1183,7 +1183,7 @@
/**
* @param {Object} [params]
* @return {Boolean} False if already inactive.
* @return {boolean} False if already inactive.
*/
deactivate: function ( params ) {
return this._toggleActive( false, params );
@ -1200,10 +1200,10 @@
/**
* Handle the toggle logic for expand/collapse.
*
* @param {Boolean} expanded - The new state to apply.
* @param {boolean} expanded - The new state to apply.
* @param {Object} [params] - Object containing options for expand/collapse.
* @param {Function} [params.completeCallback] - Function to call when expansion/collapse is complete.
* @return {Boolean} False if state already applied or active state is false.
* @return {boolean} False if state already applied or active state is false.
*/
_toggleExpanded: function( expanded, params ) {
var instance = this, previousCompleteCallback;
@ -1240,7 +1240,7 @@
/**
* @param {Object} [params]
* @return {Boolean} False if already expanded or if inactive.
* @return {boolean} False if already expanded or if inactive.
*/
expand: function ( params ) {
return this._toggleExpanded( true, params );
@ -1248,7 +1248,7 @@
/**
* @param {Object} [params]
* @return {Boolean} False if already collapsed.
* @return {boolean} False if already collapsed.
*/
collapse: function ( params ) {
return this._toggleExpanded( false, params );
@ -1409,7 +1409,7 @@
* @since 4.1.0
*
* @param {string} id - The ID for the section.
* @param {object} options - Options.
* @param {Object} options - Options.
* @param {string} options.title - Title shown when section is collapsed and expanded.
* @param {string} [options.description] - Description shown at the top of the section.
* @param {number} [options.priority=100] - The sort priority for the section.
@ -1418,7 +1418,7 @@
* @param {boolean} [options.active=true] - Whether the section is active or not.
* @param {string} options.panel - The ID for the panel this section is associated with.
* @param {string} [options.customizeAction] - Additional context information shown before the section title when expanded.
* @param {object} [options.params] - Deprecated wrapper for the above properties.
* @param {Object} [options.params] - Deprecated wrapper for the above properties.
*/
initialize: function ( id, options ) {
var section = this, params;
@ -1545,7 +1545,7 @@
*
* @since 4.1.0
*
* @return {Boolean}
* @return {boolean}
*/
isContextuallyActive: function () {
var section = this,
@ -1575,7 +1575,7 @@
*
* @since 4.1.0
*
* @param {Boolean} expanded
* @param {boolean} expanded
* @param {Object} args
*/
onChangeExpanded: function ( expanded, args ) {
@ -1697,7 +1697,7 @@
* @since 4.9.0
*
* @param {string} id - ID.
* @param {object} options - Options.
* @param {Object} options - Options.
* @return {void}
*/
initialize: function( id, options ) {
@ -1799,7 +1799,7 @@
*
* @since 4.2.0
*
* @return {Boolean}
* @return {boolean}
*/
isContextuallyActive: function () {
return this.active();
@ -1951,9 +1951,9 @@
*
* @since 4.2.0
*
* @param {Boolean} expanded
* @param {boolean} expanded
* @param {Object} args
* @param {Boolean} args.unchanged
* @param {boolean} args.unchanged
* @param {Function} args.completeCallback
* @return {void}
*/
@ -2167,7 +2167,7 @@
*
* @since 4.9.0
* @param {Array} themes - Array of theme data to create controls with.
* @param {integer} page - Page of results being loaded.
* @param {number} page - Page of results being loaded.
* @return {void}
*/
loadControls: function( themes, page ) {
@ -2412,7 +2412,7 @@
*
* @since 4.9.0
*
* @return {int} Visible count.
* @return {number} Visible count.
*/
getVisibleCount: function() {
return this.contentContainer.find( 'li.customize-control:visible' ).length;
@ -2559,7 +2559,7 @@
*
* @since 4.2.0
*
* @param {object} theme - Theme.
* @param {Object} theme - Theme.
* @param {Function} [callback] - Callback once the details have been shown.
* @return {void}
*/
@ -2667,7 +2667,7 @@
*
* @since 4.9.0
*
* @param {Boolean} expanded - The expanded state to transition to.
* @param {boolean} expanded - The expanded state to transition to.
* @param {Object} [args] - Args.
* @param {boolean} [args.unchanged] - Whether the state is already known to not be changed, and so short-circuit with calling completeCallback early.
* @param {Function} [args.completeCallback] - Function to call when the slideUp/slideDown has completed.
@ -2762,14 +2762,14 @@
* @since 4.1.0
*
* @param {string} id - The ID for the panel.
* @param {object} options - Object containing one property: params.
* @param {Object} options - Object containing one property: params.
* @param {string} options.title - Title shown when panel is collapsed and expanded.
* @param {string} [options.description] - Description shown at the top of the panel.
* @param {number} [options.priority=100] - The sort priority for the panel.
* @param {string} [options.type=default] - The type of the panel. See wp.customize.panelConstructor.
* @param {string} [options.content] - The markup to be used for the panel container. If empty, a JS template is used.
* @param {boolean} [options.active=true] - Whether the panel is active or not.
* @param {object} [options.params] - Deprecated wrapper for the above properties.
* @param {Object} [options.params] - Deprecated wrapper for the above properties.
*/
initialize: function ( id, options ) {
var panel = this, params;
@ -2905,9 +2905,9 @@
*
* @since 4.1.0
*
* @param {Boolean} expanded
* @param {boolean} expanded
* @param {Object} args
* @param {Boolean} args.unchanged
* @param {boolean} args.unchanged
* @param {Function} args.completeCallback
* @return {void}
*/
@ -3036,7 +3036,7 @@
* @since 4.9.0
*
* @param {string} id - The ID for the panel.
* @param {object} options - Options.
* @param {Object} options - Options.
* @return {void}
*/
initialize: function( id, options ) {
@ -3133,9 +3133,9 @@
*
* @since 4.9.0
*
* @param {Boolean} expanded - Expanded state.
* @param {boolean} expanded - Expanded state.
* @param {Object} args - Args.
* @param {Boolean} args.unchanged - Whether or not the state changed.
* @param {boolean} args.unchanged - Whether or not the state changed.
* @param {Function} args.completeCallback - Callback to execute when the animation completes.
* @return {void}
*/
@ -3482,8 +3482,8 @@
* @borrows wp.customize~Container#_toggleActive as this#_toggleActive
*
* @param {string} id - Unique identifier for the control instance.
* @param {object} options - Options hash for the control instance.
* @param {object} options.type - Type of control (e.g. text, radio, dropdown-pages, etc.)
* @param {Object} options - Options hash for the control instance.
* @param {Object} options.type - Type of control (e.g. text, radio, dropdown-pages, etc.)
* @param {string} [options.content] - The HTML content for the control or at least its container. This should normally be left blank and instead supplying a templateId.
* @param {string} [options.templateId] - Template ID for control's content.
* @param {string} [options.priority=10] - Order of priority to show the control within the section.
@ -3496,7 +3496,7 @@
* @param {string} options.label - Label.
* @param {string} options.description - Description.
* @param {number} [options.instanceNumber] - Order in which this instance was created in relation to other instances.
* @param {object} [options.params] - Deprecated wrapper for the above properties.
* @param {Object} [options.params] - Deprecated wrapper for the above properties.
* @return {void}
*/
initialize: function( id, options ) {
@ -3900,9 +3900,9 @@
*
* @since 4.1.0
*
* @param {Boolean} active
* @param {boolean} active
* @param {Object} args
* @param {Number} args.duration
* @param {number} args.duration
* @param {Function} args.completeCallback
*/
onChangeActive: function ( active, args ) {
@ -4355,7 +4355,7 @@
/**
* Called when the "Remove" link is clicked. Empties the setting.
*
* @param {object} event jQuery Event object
* @param {Object} event jQuery Event object
*/
removeFile: function( event ) {
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
@ -4565,7 +4565,7 @@
/**
* After the image has been cropped, apply the cropped image data to the setting.
*
* @param {object} croppedImage Cropped attachment data.
* @param {Object} croppedImage Cropped attachment data.
*/
onCropped: function( croppedImage ) {
this.setImageFromAttachment( croppedImage );
@ -4641,13 +4641,13 @@
/**
* Return whether the image must be cropped, based on required dimensions.
*
* @param {bool} flexW
* @param {bool} flexH
* @param {int} dstW
* @param {int} dstH
* @param {int} imgW
* @param {int} imgH
* @return {bool}
* @param {boolean} flexW
* @param {boolean} flexH
* @param {number} dstW
* @param {number} dstH
* @param {number} imgW
* @param {number} imgH
* @return {boolean}
*/
mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) {
if ( true === flexW && true === flexH ) {
@ -4684,7 +4684,7 @@
/**
* Updates the setting and re-renders the control UI.
*
* @param {object} attachment
* @param {Object} attachment
*/
setImageFromAttachment: function( attachment ) {
this.params.attachment = attachment;
@ -4770,7 +4770,7 @@
/**
* Updates the setting and re-renders the control UI.
*
* @param {object} attachment
* @param {Object} attachment
*/
setImageFromAttachment: function( attachment ) {
var sizes = [ 'site_icon-32', 'thumbnail', 'full' ], link,
@ -4799,7 +4799,7 @@
/**
* Called when the "Remove" link is clicked. Empties the setting.
*
* @param {object} event jQuery Event object
* @param {Object} event jQuery Event object
*/
removeFile: function( event ) {
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
@ -5009,7 +5009,7 @@
/**
* After the image has been cropped, apply the cropped image data to the setting.
*
* @param {object} croppedImage Cropped attachment data.
* @param {Object} croppedImage Cropped attachment data.
*/
onCropped: function(croppedImage) {
var url = croppedImage.url,
@ -5022,7 +5022,7 @@
/**
* If cropping was skipped, apply the image data directly to the setting.
*
* @param {object} selection
* @param {Object} selection
*/
onSkippedCrop: function(selection) {
var url = selection.get('url'),
@ -5036,10 +5036,10 @@
* header image data and inserts it into the user-uploaded headers
* collection.
*
* @param {String} url
* @param {Number} attachmentId
* @param {Number} width
* @param {Number} height
* @param {string} url
* @param {number} attachmentId
* @param {number} width
* @param {number} height
*/
setImageFromURL: function(url, attachmentId, width, height) {
var choice, data = {};
@ -5245,7 +5245,7 @@
*
* @since 4.9.0
* @param {string} id - Unique identifier for the control instance.
* @param {object} options - Options hash for the control instance.
* @param {Object} options - Options hash for the control instance.
* @return {void}
*/
initialize: function( id, options ) {
@ -5384,7 +5384,7 @@
* Initialize syntax-highlighting editor.
*
* @since 4.9.0
* @param {object} codeEditorSettings - Code editor settings.
* @param {Object} codeEditorSettings - Code editor settings.
* @return {void}
*/
initSyntaxHighlightingEditor: function( codeEditorSettings ) {
@ -5626,7 +5626,7 @@
* @since 4.9.0
*
* @param {string} datetime - Date/Time string. Accepts Y-m-d[ H:i[:s]] format.
* @return {object|null} Returns object containing date components or null if parse error.
* @return {Object|null} Returns object containing date components or null if parse error.
*/
parseDateTime: function parseDateTime( datetime ) {
var control = this, matches, date, midDayHour = 12;
@ -6218,10 +6218,10 @@
* @constructs wp.customize.PreviewFrame
* @augments wp.customize.Messenger
*
* @param {object} params.container
* @param {object} params.previewUrl
* @param {object} params.query
* @param {object} options
* @param {Object} params.container
* @param {Object} params.previewUrl
* @param {Object} params.query
* @param {Object} options
*/
initialize: function( params, options ) {
var deferred = $.Deferred();
@ -6248,7 +6248,7 @@
/**
* Run the preview request.
*
* @param {object} deferred jQuery Deferred object to be resolved with
* @param {Object} deferred jQuery Deferred object to be resolved with
* the request.
*/
run: function( deferred ) {
@ -6456,12 +6456,12 @@
* @constructs wp.customize.Previewer
* @augments wp.customize.Messenger
*
* @param {array} params.allowedUrls
* @param {Array} params.allowedUrls
* @param {string} params.container A selector or jQuery element for the preview
* frame to be placed.
* @param {string} params.form
* @param {string} params.previewUrl The URL to preview.
* @param {object} options
* @param {Object} options
*/
initialize: function( params, options ) {
var previewer = this,
@ -6609,11 +6609,11 @@
* @since 4.7.0
* @access public
*
* @param {object} data - Data from preview.
* @param {Object} data - Data from preview.
* @param {string} data.currentUrl - Current URL.
* @param {object} data.activePanels - Active panels.
* @param {object} data.activeSections Active sections.
* @param {object} data.activeControls Active controls.
* @param {Object} data.activePanels - Active panels.
* @param {Object} data.activeSections Active sections.
* @param {Object} data.activeControls Active controls.
* @return {void}
*/
ready: function( data ) {
@ -6917,8 +6917,8 @@
* @since 4.6.0
* @private
*
* @param {object} args
* @param {object} args.settingValidities
* @param {Object} args
* @param {Object} args.settingValidities
* @param {boolean} [args.focusInvalidControl=false]
* @return {void}
*/
@ -6993,7 +6993,7 @@
*
* @since 4.6.0
* @param {string[]} settingIds Setting IDs.
* @return {object<string, wp.customize.Control>} Mapping setting ids to arrays of controls.
* @return {Object<string, wp.customize.Control>} Mapping setting ids to arrays of controls.
*/
api.findControlsForSettings = function findControlsForSettings( settingIds ) {
var controls = {}, settingControls;
@ -7401,9 +7401,9 @@
* @since 4.7.0 Added options param.
* @access public
*
* @param {object} [options] Options.
* @param {Object} [options] Options.
* @param {boolean} [options.excludeCustomizedSaved=false] Exclude saved settings in customized response (values pending writing to changeset).
* @return {object} Query vars.
* @return {Object} Query vars.
*/
query: function( options ) {
var queryVars = {
@ -7439,7 +7439,7 @@
* @since 3.4.0
* @since 4.7.0 Added args param and return value.
*
* @param {object} [args] Args.
* @param {Object} [args] Args.
* @param {string} [args.status=publish] Status.
* @param {string} [args.date] Date, in local time in MySQL format.
* @param {string} [args.title] Title
@ -8121,7 +8121,7 @@
* @since 4.9.0
*
* @param {string} [code] - Code.
* @param {object} [params] - Params.
* @param {Object} [params] - Params.
*/
initialize: function( code, params ) {
var notification = this, _code, _params;
@ -8210,8 +8210,8 @@
*
* @since 4.9.0
*
* @param {object} [args] - Args.
* @param {object} [args.lockUser] - Lock user data.
* @param {Object} [args] - Args.
* @param {Object} [args.lockUser] - Lock user data.
* @param {boolean} [args.allowOverride=false] - Whether override is allowed.
* @return {void}
*/
@ -8637,7 +8637,7 @@
* @since 4.7.0
* @access private
*
* @param {object} header - Header.
* @param {Object} header - Header.
* @param {number} scrollTop - Scroll top.
* @param {number} scrollDirection - Scroll direction, negative number being up and positive being down.
* @return {void}

View File

@ -95,7 +95,7 @@
* @since 4.7.0
* @alias wp.customize.Menus.insertAutoDraftPost
*
* @param {object} params - Parameters for the draft post to create.
* @param {Object} params - Parameters for the draft post to create.
* @param {string} params.post_type - Post type to add.
* @param {string} params.post_title - Post title to use.
* @return {jQuery.promise} Promise resolved with the added post.
@ -387,7 +387,7 @@
* @since 4.7.0 Changed function signature to take list of item types instead of single type/object.
* @access private
*
* @param {Array.<object>} itemTypes List of objects containing type and key.
* @param {Array.<Object>} itemTypes List of objects containing type and key.
* @param {string} deprecated Formerly the object parameter.
* @return {void}
*/
@ -905,7 +905,7 @@
*
* @since 4.3.0
*
* @param {String} id
* @param {string} id
* @param {Object} options
*/
initialize: function( id, options ) {
@ -2212,7 +2212,7 @@
*
* @private
*
* @param {Number} offset 1|-1
* @param {number} offset 1|-1
*/
_changePosition: function( offset ) {
var control = this,
@ -2272,7 +2272,7 @@
*
* @private
*
* @param {Number} offset 1|-1
* @param {number} offset 1|-1
*/
_changeDepth: function( offset ) {
if ( 1 !== offset && -1 !== offset ) {
@ -2655,7 +2655,7 @@
* Notice that the UI aspects here are handled by wpNavMenu.initSortables()
* which is called in MenuSection.onChangeExpanded()
*
* @param {object} menuList - The element that has sortable().
* @param {Object} menuList - The element that has sortable().
*/
_setupSortable: function( menuList ) {
var control = this;
@ -2854,7 +2854,7 @@
/**
* Enable/disable the reordering UI
*
* @param {Boolean} showOrHide to enable/disable reordering
* @param {boolean} showOrHide to enable/disable reordering
*/
toggleReordering: function( showOrHide ) {
var addNewItemBtn = this.container.find( '.add-new-menu-item' ),
@ -2994,7 +2994,7 @@
/**
* Add a new item to this menu.
*
* @param {object} item - Value for the nav_menu_item setting to be created.
* @param {Object} item - Value for the nav_menu_item setting to be created.
* @return {wp.customize.Menus.controlConstructor.nav_menu_item} The newly-created nav_menu_item control instance.
*/
addItemToMenu: function( item ) {
@ -3135,9 +3135,9 @@
*
* @alias wp.customize.Menus.applySavedData
*
* @param {object} data
* @param {array} data.nav_menu_updates
* @param {array} data.nav_menu_item_updates
* @param {Object} data
* @param {Array} data.nav_menu_updates
* @param {Array} data.nav_menu_item_updates
*/
api.Menus.applySavedData = function( data ) {
@ -3394,7 +3394,7 @@
* @alias wp.customize.Menus.getMenuItemControl
*
* @param {string} menuItemId
* @return {object|null}
* @return {Object|null}
*/
api.Menus.getMenuItemControl = function( menuItemId ) {
return api.control( menuItemIdToSettingId( menuItemId ) );
@ -3403,7 +3403,7 @@
/**
* @alias wp.customize.Menus~menuItemIdToSettingId
*
* @param {String} menuItemId
* @param {string} menuItemId
*/
function menuItemIdToSettingId( menuItemId ) {
return 'nav_menu_item[' + menuItemId + ']';

View File

@ -98,7 +98,7 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
* @param {string} options.params.navMenuArgs.args_hmac
* @param {string} [options.params.navMenuArgs.theme_location]
* @param {number} [options.params.navMenuArgs.menu]
* @param {object} [options.constructingContainerContext]
* @param {Object} [options.constructingContainerContext]
*/
initialize: function( id, options ) {
var partial = this, matches, argsHmac;
@ -132,8 +132,8 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
*
* @since 4.5.0
* @param {wp.customize.Value|string} setting - Object or ID.
* @param {number|object|false|null} newValue - New value, or null if the setting was just removed.
* @param {number|object|false|null} oldValue - Old value, or null if the setting was just added.
* @param {number|Object|false|null} newValue - New value, or null if the setting was just removed.
* @param {number|Object|false|null} oldValue - Old value, or null if the setting was just added.
* @return {boolean}
*/
isRelatedSetting: function( setting, newValue, oldValue ) {
@ -263,7 +263,7 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
/**
* Request full refresh if there are nav menu instances that lack partials which also match the supplied args.
*
* @param {object} navMenuInstanceArgs
* @param {Object} navMenuInstanceArgs
*/
self.handleUnplacedNavMenuInstances = function( navMenuInstanceArgs ) {
var unplacedNavMenuInstances;
@ -283,7 +283,7 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
* @since 4.5.0
*
* @param {wp.customize.Value} setting
* @param {object} [options]
* @param {Object} [options]
* @param {boolean} options.fire Whether to invoke the callback after binding.
* This is used when a dynamic setting is added.
* @return {boolean} Whether the setting was bound.
@ -370,8 +370,8 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
*
* @since 4.5.0
*
* @param {object} newItem New value for nav_menu_item[] setting.
* @param {object} oldItem Old value for nav_menu_item[] setting.
* @param {Object} newItem New value for nav_menu_item[] setting.
* @param {Object} oldItem Old value for nav_menu_item[] setting.
* @this {wp.customize.Value}
*/
self.onChangeNavMenuItemSetting = function( newItem, oldItem ) {

View File

@ -102,8 +102,8 @@
*/
api.Preview = api.Messenger.extend(/** @lends wp.customize.Preview.prototype */{
/**
* @param {object} params - Parameters to configure the messenger.
* @param {object} options - Extend any instance parameter or method with this object.
* @param {Object} params - Parameters to configure the messenger.
* @param {Object} options - Extend any instance parameter or method with this object.
*/
initialize: function( params, options ) {
var preview = this, urlParser = document.createElement( 'a' );
@ -276,8 +276,8 @@
* @param {string} element.search Query string.
* @param {string} element.pathname Path.
* @param {string} element.host Host.
* @param {object} [options]
* @param {object} [options.allowAdminAjax=false] Allow admin-ajax.php requests.
* @param {Object} [options]
* @param {Object} [options.allowAdminAjax=false] Allow admin-ajax.php requests.
* @return {boolean} Is appropriate for changeset link.
*/
api.isLinkPreviewable = function isLinkPreviewable( element, options ) {
@ -399,10 +399,10 @@
/**
* Rewrite Ajax requests to inject customizer state.
*
* @param {object} options Options.
* @param {Object} options Options.
* @param {string} options.type Type.
* @param {string} options.url URL.
* @param {object} originalOptions Original options.
* @param {Object} originalOptions Original options.
* @param {XMLHttpRequest} xhr XHR.
* @return {void}
*/

View File

@ -60,13 +60,13 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* @since 4.5.0
*
* @param {string} id - Unique identifier for the partial instance.
* @param {object} options - Options hash for the partial instance.
* @param {Object} options - Options hash for the partial instance.
* @param {string} options.type - Type of partial (e.g. nav_menu, widget, etc)
* @param {string} options.selector - jQuery selector to find the container element in the page.
* @param {array} options.settings - The IDs for the settings the partial relates to.
* @param {Array} options.settings - The IDs for the settings the partial relates to.
* @param {string} options.primarySetting - The ID for the primary setting the partial renders.
* @param {bool} options.fallbackRefresh - Whether to refresh the entire preview in case of a partial refresh failure.
* @param {object} [options.params] - Deprecated wrapper for the above properties.
* @param {boolean} options.fallbackRefresh - Whether to refresh the entire preview in case of a partial refresh failure.
* @param {Object} [options.params] - Deprecated wrapper for the above properties.
*/
initialize: function( id, options ) {
var partial = this;
@ -285,7 +285,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
*
* @since 4.5.0
*
* @return {String[]}
* @return {string[]}
*/
settings: function() {
var partial = this;
@ -406,8 +406,8 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
*
* @param {Placement} placement
* @param {Element|jQuery} [placement.container] - This param will be empty if there was no element matching the selector.
* @param {string|object|boolean} placement.addedContent - Rendered HTML content, a data object for JS templates to render, or false if no render.
* @param {object} [placement.context] - Optional context information about the container.
* @param {string|Object|boolean} placement.addedContent - Rendered HTML content, a data object for JS templates to render, or false if no render.
* @param {Object} [placement.context] - Optional context information about the container.
* @return {boolean} Whether the rendering was successful and the fallback was not invoked.
*/
renderContent: function( placement ) {
@ -602,12 +602,12 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
*
* @since 4.5.0
*
* @param {object} args
* @param {Object} args
* @param {Partial} args.partial
* @param {jQuery|Element} [args.container]
* @param {Node} [args.startNode]
* @param {Node} [args.endNode]
* @param {object} [args.context]
* @param {Object} [args.context]
* @param {string} [args.addedContent]
* @param {jQuery|DocumentFragment} [args.removedNodes]
*/
@ -645,7 +645,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* @since 4.5.0
* @see wp.customize.previewer.query()
*
* @return {object}
* @return {Object}
*/
self.getCustomizeQuery = function() {
var dirtyCustomized = {};

View File

@ -459,7 +459,7 @@
/**
* @param {jQuery.Event} e
* @param {jQuery} widget
* @param {String} newForm
* @param {string} newForm
*/
rss: function( e, widget, newForm ) {
var oldWidgetError = widget.find( '.widget-error:first' ),
@ -968,7 +968,7 @@
*
* @since 4.1.0
*
* @param {Boolean} active
* @param {boolean} active
* @param {Object} args
* @param {function} args.completeCallback
*/
@ -1075,7 +1075,7 @@
* Get the state for an input depending on its type.
*
* @param {jQuery|Element} input
* @return {string|boolean|array|*}
* @return {string|boolean|Array|*}
* @private
*/
_getInputState: function( input ) {
@ -1095,7 +1095,7 @@
* Update an input's state based on its type.
*
* @param {jQuery|Element} input
* @param {string|boolean|array|*} state
* @param {string|boolean|Array|*} state
* @private
*/
_setInputState: function ( input, state ) {
@ -1143,10 +1143,10 @@
* Submit the widget form via Ajax and get back the updated instance,
* along with the new widget control form to render.
*
* @param {object} [args]
* @param {Object} [args]
* @param {Object|null} [args.instance=null] When the model changes, the instance is sent here; otherwise, the inputs from the form are used
* @param {Function|null} [args.complete=null] Function which is called when the request finishes. Context is bound to the control. First argument is any error. Following arguments are for success.
* @param {Boolean} [args.ignoreActiveElement=false] Whether or not updating a field will be deferred if focus is still on the element.
* @param {boolean} [args.ignoreActiveElement=false] Whether or not updating a field will be deferred if focus is still on the element.
*/
updateWidget: function( args ) {
var self = this, instanceOverride, completeCallback, $widgetRoot, $widgetContent,
@ -1398,7 +1398,7 @@
/**
* Respond to change in the expanded state.
*
* @param {Boolean} expanded
* @param {boolean} expanded
* @param {Object} args merged on top of this.defaultActiveArguments
*/
onChangeExpanded: function ( expanded, args ) {
@ -1498,7 +1498,7 @@
/**
* Get the position (index) of the widget in the containing sidebar
*
* @return {Number}
* @return {number}
*/
getWidgetSidebarPosition: function() {
var sidebarWidgetIds, position;
@ -1530,7 +1530,7 @@
/**
* @private
*
* @param {Number} offset 1|-1
* @param {number} offset 1|-1
*/
_moveWidgetByOne: function( offset ) {
var i, sidebarWidgetsSetting, sidebarWidgetIds, adjacentWidgetId;
@ -1549,7 +1549,7 @@
/**
* Toggle visibility of the widget move area
*
* @param {Boolean} [showOrHide]
* @param {boolean} [showOrHide]
*/
toggleWidgetMoveArea: function( showOrHide ) {
var self = this, $moveWidgetArea;
@ -2007,7 +2007,7 @@
/**
* Enable/disable the reordering UI
*
* @param {Boolean} showOrHide to enable/disable reordering
* @param {boolean} showOrHide to enable/disable reordering
*
* @todo We should have a reordering state instead and rename this to onChangeReordering
*/
@ -2065,7 +2065,7 @@
/**
* @param {string} widgetId or an id_base for adding a previously non-existing widget.
* @return {object|false} widget_form control instance, or false on error.
* @return {Object|false} widget_form control instance, or false on error.
*/
addWidget: function( widgetId ) {
var self = this, controlHtml, $widget, controlType = 'widget_form', controlContainer, controlConstructor,
@ -2246,7 +2246,7 @@
/**
* Given a widget control, find the sidebar widgets control that contains it.
* @param {string} widgetId
* @return {object|null}
* @return {Object|null}
*/
api.Widgets.getSidebarWidgetControlContainingWidget = function( widgetId ) {
var foundControl = null;
@ -2265,7 +2265,7 @@
* Given a widget ID for a widget appearing in the preview, get the widget form control associated with it.
*
* @param {string} widgetId
* @return {object|null}
* @return {Object|null}
*/
api.Widgets.getWidgetFormControlForWidget = function( widgetId ) {
var foundControl = null;
@ -2333,7 +2333,7 @@
}
/**
* @param {String} widgetId
* @param {string} widgetId
* @return {Object}
*/
function parseWidgetId( widgetId ) {
@ -2355,8 +2355,8 @@
}
/**
* @param {String} widgetId
* @return {String} settingId
* @param {string} widgetId
* @return {string} settingId
*/
function widgetIdToSettingId( widgetId ) {
var parsed = parseWidgetId( widgetId ), settingId;

View File

@ -473,7 +473,7 @@ window.wp = window.wp || {};
* The method directly manipulates the `textarea` content, to allow TinyMCE plugins
* to run after the markers are added.
*
* @param {object} $textarea TinyMCE's textarea wrapped as a DomQuery object
* @param {Object} $textarea TinyMCE's textarea wrapped as a DomQuery object
*/
function addHTMLBookmarkInTextAreaContent( $textarea ) {
if ( ! $textarea || ! $textarea.length ) {
@ -561,7 +561,7 @@ window.wp = window.wp || {};
* By default TinyMCE wraps loose inline tags in a `<p>`.
* When removing selection markers an empty `<p>` may be left behind, remove it.
*
* @param {object} $marker The marker to be removed from the editor DOM, wrapped in an instnce of `editor.$`
* @param {Object} $marker The marker to be removed from the editor DOM, wrapped in an instnce of `editor.$`
*/
function removeSelectionMarker( $marker ) {
var $markerParent = $marker.parent();
@ -1132,8 +1132,8 @@ window.wp = window.wp || {};
*
* @memberof switchEditors
*
* @param {String} html The content from the visual editor.
* @return {String} the filtered content.
* @param {string} html The content from the visual editor.
* @return {string} the filtered content.
*/
function pre_wpautop( html ) {
var obj = { o: exports, data: html, unfiltered: html };
@ -1158,8 +1158,8 @@ window.wp = window.wp || {};
*
* @memberof switchEditors
*
* @param {String} text The content from the text editor.
* @return {String} filtered content.
* @param {string} text The content from the text editor.
* @return {string} filtered content.
*/
function wpautop( text ) {
var obj = { o: exports, data: text, unfiltered: text };
@ -1225,7 +1225,7 @@ window.wp = window.wp || {};
*
* @param {string} id The HTML id of the textarea that is used for the editor.
* Has to be jQuery compliant. No brackets, special chars, etc.
* @param {object} settings Example:
* @param {Object} settings Example:
* settings = {
* // See https://www.tinymce.com/docs/configure/integration-and-setup/.
* // Alternatively set to `true` to use the defaults.

View File

@ -204,7 +204,7 @@
/**
* Gets the offset of the editor.
*
* @return {Number|Boolean} Returns the offset of the editor
* @return {number|boolean} Returns the offset of the editor
* or false if there is no offset height.
*/
function mceGetCursorOffset() {

View File

@ -46,7 +46,7 @@
/**
* Registers a new view type.
*
* @param {String} type The view type.
* @param {string} type The view type.
* @param {Object} extend An object to extend wp.mce.View.prototype with.
*/
register: function( type, extend ) {
@ -56,7 +56,7 @@
/**
* Unregisters a view type.
*
* @param {String} type The view type.
* @param {string} type The view type.
*/
unregister: function( type ) {
delete views[ type ];
@ -65,7 +65,7 @@
/**
* Returns the settings of a view type.
*
* @param {String} type The view type.
* @param {string} type The view type.
*
* @return {Function} The view constructor.
*/
@ -88,10 +88,10 @@
* replacing any matches with markers,
* and creates a new instance for every match.
*
* @param {String} content The string to scan.
* @param {string} content The string to scan.
* @param {tinymce.Editor} editor The editor.
*
* @return {String} The string with markers.
* @return {string} The string with markers.
*/
setMarkers: function( content, editor ) {
var pieces = [ { content: content } ],
@ -149,10 +149,10 @@
/**
* Create a view instance.
*
* @param {String} type The view type.
* @param {String} text The textual representation of the view.
* @param {string} type The view type.
* @param {string} text The textual representation of the view.
* @param {Object} options Options.
* @param {Boolean} force Recreate the instance. Optional.
* @param {boolean} force Recreate the instance. Optional.
*
* @return {wp.mce.View} The view instance.
*/
@ -190,7 +190,7 @@
/**
* Get a view instance.
*
* @param {(String|HTMLElement)} object The textual representation of the view or the view node.
* @param {(string|HTMLElement)} object The textual representation of the view or the view node.
*
* @return {wp.mce.View} The view instance or undefined.
*/
@ -207,7 +207,7 @@
*
* @param {HTMLElement} node The view node.
*
* @return {String} The textual representation of the view.
* @return {string} The textual representation of the view.
*/
getText: function( node ) {
return decodeURIComponent( $( node ).attr( 'data-wpview-text' ) || '' );
@ -216,7 +216,7 @@
/**
* Renders all view nodes that are not yet rendered.
*
* @param {Boolean} force Rerender all view nodes.
* @param {boolean} force Rerender all view nodes.
*/
render: function( force ) {
_.each( instances, function( instance ) {
@ -227,10 +227,10 @@
/**
* Update the text of a given view node.
*
* @param {String} text The new text.
* @param {string} text The new text.
* @param {tinymce.Editor} editor The TinyMCE editor instance the view node is in.
* @param {HTMLElement} node The view node to update.
* @param {Boolean} force Recreate the instance. Optional.
* @param {boolean} force Recreate the instance. Optional.
*/
update: function( text, editor, node, force ) {
var instance = this.getInstance( node );
@ -317,8 +317,8 @@
/**
* Renders all view nodes tied to this view instance that are not yet rendered.
*
* @param {String} content The content to render. Optional.
* @param {Boolean} force Rerender all view nodes tied to this view instance. Optional.
* @param {string} content The content to render. Optional.
* @param {boolean} force Rerender all view nodes tied to this view instance. Optional.
*/
render: function( content, force ) {
if ( content != null ) {
@ -385,7 +385,7 @@
* Gets all view nodes tied to this view instance.
*
* @param {Function} callback A callback.
* @param {Boolean} rendered Get (un)rendered view nodes. Optional.
* @param {boolean} rendered Get (un)rendered view nodes. Optional.
*/
getNodes: function( callback, rendered ) {
this.getEditors( function( editor ) {
@ -473,7 +473,7 @@
*
* @param {*} content The content to set.
* @param {Function} callback A callback. Optional.
* @param {Boolean} rendered Only set for (un)rendered nodes. Optional.
* @param {boolean} rendered Only set for (un)rendered nodes. Optional.
*/
setContent: function( content, callback, rendered ) {
if ( _.isObject( content ) && ( content.sandbox || content.head || content.body.indexOf( '<script' ) !== -1 ) ) {
@ -502,10 +502,10 @@
/**
* Sets the content in an iframe for all view nodes tied to this view instance.
*
* @param {String} head HTML string to be added to the head of the document.
* @param {String} body HTML string to be added to the body of the document.
* @param {string} head HTML string to be added to the head of the document.
* @param {string} body HTML string to be added to the body of the document.
* @param {Function} callback A callback. Optional.
* @param {Boolean} rendered Only set for (un)rendered nodes. Optional.
* @param {boolean} rendered Only set for (un)rendered nodes. Optional.
*/
setIframes: function( head, body, callback, rendered ) {
var self = this;
@ -698,8 +698,8 @@
/**
* Sets an error for all view nodes tied to this view instance.
*
* @param {String} message The error message to set.
* @param {String} dashicon A dashicon ID. Optional. {@link https://developer.wordpress.org/resource/dashicons/}
* @param {string} message The error message to set.
* @param {string} dashicon A dashicon ID. Optional. {@link https://developer.wordpress.org/resource/dashicons/}
*/
setError: function( message, dashicon ) {
this.setContent(
@ -713,7 +713,7 @@
/**
* Tries to find a text match in a given string.
*
* @param {String} content The string to scan.
* @param {string} content The string to scan.
*
* @return {Object}
*/
@ -734,10 +734,10 @@
/**
* Update the text of a given view node.
*
* @param {String} text The new text.
* @param {string} text The new text.
* @param {tinymce.Editor} editor The TinyMCE editor instance the view node is in.
* @param {HTMLElement} node The view node to update.
* @param {Boolean} force Recreate the instance. Optional.
* @param {boolean} force Recreate the instance. Optional.
*/
update: function( text, editor, node, force ) {
_.find( views, function( view, type ) {

View File

@ -19,7 +19,7 @@
* passed as an input that expects booleans. If key is undefined in the map,
* but has a default value, set it.
*
* @param {object} attrs Map of props from a shortcode or settings.
* @param {Object} attrs Map of props from a shortcode or settings.
* @param {string} key The key within the passed map to check for a value.
* @return {mixed|undefined} The original or coerced value of key within attrs.
*/

View File

@ -17,7 +17,7 @@ window.wp = window.wp || {};
* @memberOf wp
* @namespace
*
* @param {object} attributes The properties passed to the main media controller.
* @param {Object} attributes The properties passed to the main media controller.
* @return {wp.media.view.MediaFrame} A media workflow.
*/
media = wp.media = function( attributes ) {
@ -183,10 +183,10 @@ _.extend( media, /** @lends wp.media */{
* Truncates a string by injecting an ellipsis into the middle.
* Useful for filenames.
*
* @param {String} string
* @param {Number} [length=30]
* @param {String} [replacement=&hellip;]
* @return {String} The string, unless length is greater than string.length.
* @param {string} string
* @param {number} [length=30]
* @param {string} [replacement=&hellip;]
* @return {string} The string, unless length is greater than string.length.
*/
truncate: function( string, length, replacement ) {
length = length || 30;
@ -209,7 +209,7 @@ _.extend( media, /** @lends wp.media */{
* wp.media.attachment
*
* @static
* @param {String} id A string used to identify a model.
* @param {string} id A string used to identify a model.
* @return {wp.media.model.Attachment}
*/
media.attachment = function( id ) {
@ -229,7 +229,7 @@ Attachments.all = new Attachments();
*
* Shorthand for creating a new Attachments Query.
*
* @param {object} [props]
* @param {Object} [props]
* @return {wp.media.model.Attachments}
*/
media.query = function( props ) {

View File

@ -48,7 +48,7 @@ media.events = _.extend( {}, Backbone.Events );
* Makes it easier to bind events using transitions.
*
* @param {string} selector
* @param {Number} sensitivity
* @param {number} sensitivity
* @return {Promise}
*/
media.transition = function( selector, sensitivity ) {

View File

@ -27,8 +27,8 @@ wp.themePluginEditor = (function( $ ) {
* @since 4.9.0
*
* @param {jQuery} form - Form element.
* @param {object} settings - Settings.
* @param {object|boolean} settings.codeEditor - Code editor settings (or `false` if syntax highlighting is disabled).
* @param {Object} settings - Settings.
* @param {Object|boolean} settings.codeEditor - Code editor settings (or `false` if syntax highlighting is disabled).
* @return {void}
*/
component.init = function init( form, settings ) {
@ -117,7 +117,7 @@ wp.themePluginEditor = (function( $ ) {
* Constrain tabbing within the warning modal.
*
* @since 4.9.0
* @param {object} event jQuery event object.
* @param {Object} event jQuery event object.
* @return {void}
*/
component.constrainTabbing = function( event ) {
@ -254,7 +254,7 @@ wp.themePluginEditor = (function( $ ) {
*
* @since 4.9.0
*
* @param {object} notice - Notice.
* @param {Object} notice - Notice.
* @param {string} notice.code - Code.
* @param {string} notice.type - Type.
* @param {string} notice.message - Message.

View File

@ -1428,7 +1428,7 @@ themes.view.Search = wp.Backbone.View.extend({
* @since 4.9.0
*
* @param {string} url - URL to navigate to.
* @param {object} state - State.
* @param {Object} state - State.
* @return {void}
*/
function navigateRouter( url, state ) {
@ -1841,7 +1841,7 @@ themes.view.Installer = themes.view.Appearance.extend({
/**
* Get the checked filters.
*
* @return {array} of tags or false
* @return {Array} of tags or false
*/
filtersChecked: function() {
var items = $( '.filter-group' ).find( ':checkbox' ),

View File

@ -150,7 +150,7 @@
*
* @since 4.6.0
*
* @param {object} data
* @param {Object} data
* @param {*=} data.selector Optional. Selector of an element to be replaced with the admin notice.
* @param {string=} data.id Optional. Unique id that will be used as the notice's id attribute.
* @param {string=} data.className Optional. Class names that will be used in the admin notice.
@ -194,7 +194,7 @@
* @since 4.6.0
*
* @param {string} action The type of Ajax request ('update-plugin', 'install-theme', etc).
* @param {object} data Data that needs to be passed to the ajax callback.
* @param {Object} data Data that needs to be passed to the ajax callback.
* @return {$.promise} A jQuery promise that represents the request,
* decorated with an abort() method.
*/
@ -243,8 +243,8 @@
*
* @since 4.6.0
*
* @param {object} response
* @param {array=} response.debug Optional. Debug information.
* @param {Object} response
* @param {Array=} response.debug Optional. Debug information.
* @param {string=} response.errorCode Optional. Error code for an error that occurred.
*/
wp.updates.ajaxAlways = function( response ) {
@ -355,7 +355,7 @@
* @since 4.2.0
* @since 4.6.0 More accurately named `updatePlugin`.
*
* @param {object} args Arguments.
* @param {Object} args Arguments.
* @param {string} args.plugin Plugin basename.
* @param {string} args.slug Plugin slug.
* @param {updatePluginSuccess=} args.success Optional. Success callback. Default: wp.updates.updatePluginSuccess
@ -412,7 +412,7 @@
* @since 4.6.0 More accurately named `updatePluginSuccess`.
* @since 5.5.0 Auto-update "time to next update" text cleared.
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the plugin to be updated.
* @param {string} response.plugin Basename of the plugin to be updated.
* @param {string} response.pluginName Name of the plugin to be updated.
@ -466,7 +466,7 @@
* @since 4.2.0
* @since 4.6.0 More accurately named `updatePluginError`.
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the plugin to be updated.
* @param {string} response.plugin Basename of the plugin to be updated.
* @param {string=} response.pluginName Optional. Name of the plugin to be updated.
@ -562,7 +562,7 @@
*
* @since 4.6.0
*
* @param {object} args Arguments.
* @param {Object} args Arguments.
* @param {string} args.slug Plugin identifier in the WordPress.org Plugin repository.
* @param {installPluginSuccess=} args.success Optional. Success callback. Default: wp.updates.installPluginSuccess
* @param {installPluginError=} args.error Optional. Error callback. Default: wp.updates.installPluginError
@ -613,7 +613,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the installed plugin.
* @param {string} response.pluginName Name of the installed plugin.
* @param {string} response.activateUrl URL to activate the just installed plugin.
@ -678,7 +678,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the plugin to be installed.
* @param {string=} response.pluginName Optional. Name of the plugin to be installed.
* @param {string} response.errorCode Error code for the error that occurred.
@ -739,7 +739,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the installed plugin.
* @param {string} response.pluginName Name of the installed plugin.
* @param {string} response.activateUrl URL to activate the just installed plugin.
@ -778,7 +778,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the plugin to be installed.
* @param {string=} response.pluginName Optional. Name of the plugin to be installed.
* @param {string} response.errorCode Error code for the error that occurred.
@ -829,7 +829,7 @@
*
* @since 4.6.0
*
* @param {object} args Arguments.
* @param {Object} args Arguments.
* @param {string} args.plugin Basename of the plugin to be deleted.
* @param {string} args.slug Slug of the plugin to be deleted.
* @param {deletePluginSuccess=} args.success Optional. Success callback. Default: wp.updates.deletePluginSuccess
@ -956,7 +956,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the plugin to be deleted.
* @param {string} response.plugin Base name of the plugin to be deleted
* @param {string=} response.pluginName Optional. Name of the plugin to be deleted.
@ -1013,7 +1013,7 @@
*
* @since 4.6.0
*
* @param {object} args Arguments.
* @param {Object} args Arguments.
* @param {string} args.slug Theme stylesheet.
* @param {updateThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.updateThemeSuccess
* @param {updateThemeError=} args.error Optional. Error callback. Default: wp.updates.updateThemeError
@ -1069,9 +1069,9 @@
* @since 4.6.0
* @since 5.5.0 Auto-update "time to next update" text cleared.
*
* @param {object} response
* @param {Object} response
* @param {string} response.slug Slug of the theme to be updated.
* @param {object} response.theme Updated theme.
* @param {Object} response.theme Updated theme.
* @param {string} response.oldVersion Old version of the theme.
* @param {string} response.newVersion New version of the theme.
*/
@ -1134,7 +1134,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the theme to be updated.
* @param {string} response.errorCode Error code for the error that occurred.
* @param {string} response.errorMessage The error that occurred.
@ -1184,7 +1184,7 @@
*
* @since 4.6.0
*
* @param {object} args
* @param {Object} args
* @param {string} args.slug Theme stylesheet.
* @param {installThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.installThemeSuccess
* @param {installThemeError=} args.error Optional. Error callback. Default: wp.updates.installThemeError
@ -1231,7 +1231,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the theme to be installed.
* @param {string} response.customizeUrl URL to the Customizer for the just installed theme.
* @param {string} response.activateUrl URL to activate the just installed theme.
@ -1310,7 +1310,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the theme to be installed.
* @param {string} response.errorCode Error code for the error that occurred.
* @param {string} response.errorMessage The error that occurred.
@ -1376,7 +1376,7 @@
*
* @since 4.6.0
*
* @param {object} args
* @param {Object} args
* @param {string} args.slug Theme stylesheet.
* @param {deleteThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.deleteThemeSuccess
* @param {deleteThemeError=} args.error Optional. Error callback. Default: wp.updates.deleteThemeError
@ -1418,7 +1418,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the theme that was deleted.
*/
wp.updates.deleteThemeSuccess = function( response ) {
@ -1476,7 +1476,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the theme to be deleted.
* @param {string} response.errorCode Error code for the error that occurred.
* @param {string} response.errorMessage The error that occurred.
@ -1531,9 +1531,9 @@
* @since 4.6.0
* @private
*
* @param {object} data Ajax payload.
* @param {Object} data Ajax payload.
* @param {string} action The type of request to perform.
* @return {object} The Ajax payload with the appropriate callbacks.
* @return {Object} The Ajax payload with the appropriate callbacks.
*/
wp.updates._addCallbacks = function( data, action ) {
if ( 'import' === pagenow && 'install-plugin' === action ) {
@ -1725,7 +1725,7 @@
*
* @since 4.2.0
*
* @param {object} response Ajax response.
* @param {Object} response Ajax response.
* @param {string} action The type of request to perform.
*/
wp.updates.credentialError = function( response, action ) {
@ -1753,7 +1753,7 @@
*
* @since 4.6.0
*
* @param {object} response Response from the server.
* @param {Object} response Response from the server.
* @param {string} response.errorCode Error code for the error that occurred.
* @param {string} response.errorMessage The error that occurred.
* @param {string} action The type of request to perform.
@ -1773,7 +1773,7 @@
*
* If the response deems to be invalid, an admin notice is being displayed.
*
* @param {(object|string)} response Response from the server.
* @param {(Object|string)} response Response from the server.
* @param {function=} response.always Optional. Callback for when the Deferred is resolved or rejected.
* @param {string=} response.statusText Optional. Status message corresponding to the status code.
* @param {string=} response.responseText Optional. Request response as text.

View File

@ -56,9 +56,9 @@ window.wp = window.wp || {};
*
* Sends a POST request to WordPress.
*
* @param {(string|object)} action The slug of the action to fire in WordPress or options passed
* @param {(string|Object)} action The slug of the action to fire in WordPress or options passed
* to jQuery.ajax.
* @param {object=} data Optional. The data to populate $_POST with.
* @param {Object=} data Optional. The data to populate $_POST with.
* @return {$.promise} A jQuery promise that represents the request,
* decorated with an abort() method.
*/
@ -73,9 +73,9 @@ window.wp = window.wp || {};
*
* Sends a POST request to WordPress.
*
* @param {(string|object)} action The slug of the action to fire in WordPress or options passed
* @param {(string|Object)} action The slug of the action to fire in WordPress or options passed
* to jQuery.ajax.
* @param {object=} options Optional. The options passed to jQuery.ajax.
* @param {Object=} options Optional. The options passed to jQuery.ajax.
* @return {$.promise} A jQuery promise that represents the request,
* decorated with an abort() method.
*/

View File

@ -38,7 +38,7 @@
* @param {RegExp} settings.shortcodesRegExp Optional. Regular expression to find shortcodes.
* @param {Object} settings.l10n Optional. Localization object containing specific
* configuration for the current localization.
* @param {String} settings.l10n.type Optional. Method of finding words to count.
* @param {string} settings.l10n.type Optional. Method of finding words to count.
* @param {Array} settings.l10n.shortcodes Optional. Array of shortcodes that should be removed
* from the text.
*
@ -148,10 +148,10 @@
*
* @memberof wp.utils.wordcounter
*
* @param {String} text Text to count elements in.
* @param {String} type Optional. Specify type to use.
* @param {string} text Text to count elements in.
* @param {string} type Optional. Specify type to use.
*
* @return {Number} The number of items counted.
* @return {number} The number of items counted.
*/
WordCounter.prototype.count = function( text, type ) {
var count = 0;

View File

@ -413,7 +413,7 @@ wp.customHtmlWidgets = ( function( $ ) {
*
* @alias wp.customHtmlWidgets.init
*
* @param {object} settings - Options for code editor, exported from PHP.
* @param {Object} settings - Options for code editor, exported from PHP.
*
* @return {void}
*/

View File

@ -100,7 +100,7 @@ wp.mediaWidgets = ( function( $ ) {
*
* @since 4.9.0
*
* @param {object} options - Options.
* @param {Object} options - Options.
* @return {void}
*/
initialize: function( options ) {

View File

@ -191,7 +191,7 @@ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Librar
* @since 4.4.1
*
* @param {wp.media.model.Attachment} attachment
* @return {Boolean}
* @return {boolean}
*/
isImageAttachment: function( attachment ) {
// If uploading, we know the filename but not the mime type.
@ -208,7 +208,7 @@ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Librar
* @since 3.6.0
*
* @param {wp.media.model.Attachment} attachment
* @return {Boolean}
* @return {boolean}
*/
canEmbed: function( attachment ) {
// If uploading, we know the filename but not the mime type.

View File

@ -15,7 +15,7 @@
*
* @class
*
* @param {object} options Options hash for the region.
* @param {Object} options Options hash for the region.
* @param {string} options.id Unique identifier for the region.
* @param {Backbone.View} options.view A parent view the region exists within.
* @param {string} options.selector jQuery selector for the region within the parent view.

View File

@ -87,7 +87,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
* @access private
*
* @param {Backbone.Model} model
* @param {Boolean} query
* @param {boolean} query
*/
_changeQuery: function( model, query ) {
if ( query ) {
@ -147,7 +147,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
* Checks whether an attachment is valid.
*
* @param {wp.media.model.Attachment} attachment
* @return {Boolean}
* @return {boolean}
*/
validator: function( attachment ) {
@ -190,7 +190,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
* Add or remove all attachments from another collection depending on each one's validity.
*
* @param {wp.media.model.Attachments} attachments
* @param {object} [options={}]
* @param {Object} [options={}]
*
* @fires wp.media.model.Attachments#reset
*
@ -314,7 +314,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
* and forwards to its `more` method. This collection class doesn't have
* server persistence by itself.
*
* @param {object} options
* @param {Object} options
* @return {Promise}
*/
more: function( options ) {
@ -447,7 +447,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
* @param {Backbone.Model} a
* @param {Backbone.Model} b
* @param {Object} options
* @return {Number} -1 if the first model should come before the second,
* @return {number} -1 if the first model should come before the second,
* 0 if they are of the same rank and
* 1 if the first model should come after.
*/
@ -501,7 +501,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
*
* @this wp.media.model.Attachments
*
* @return {Boolean}
* @return {boolean}
*/
type: function( attachment ) {
var type = this.props.get('type'), atts = attachment.toJSON(), mime, found;
@ -528,7 +528,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
*
* @this wp.media.model.Attachments
*
* @return {Boolean}
* @return {boolean}
*/
uploadedTo: function( attachment ) {
var uploadedTo = this.props.get('uploadedTo');
@ -544,7 +544,7 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
*
* @this wp.media.model.Attachments
*
* @return {Boolean}
* @return {boolean}
*/
status: function( attachment ) {
var status = this.props.get('status');

View File

@ -22,8 +22,8 @@ var Attachments = wp.media.model.Attachments,
*/
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
/**
* @param {array} [models=[]] Array of initial models to populate the collection.
* @param {object} [options={}]
* @param {Array} [models=[]] Array of initial models to populate the collection.
* @param {Object} [options={}]
*/
initialize: function( models, options ) {
var allowed;
@ -94,7 +94,7 @@ Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
/**
* Fetch more attachments from the server for the collection.
*
* @param {object} [options={}]
* @param {Object} [options={}]
* @return {Promise}
*/
more: function( options ) {
@ -122,7 +122,7 @@ Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
* Overrides Backbone.Collection.sync
* Overrides wp.media.model.Attachments.sync
*
* @param {String} method
* @param {string} method
* @param {Backbone.Model} model
* @param {Object} [options={}]
* @return {Promise}

View File

@ -286,7 +286,7 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
this[ this.selected() ? 'select' : 'deselect' ]();
},
/**
* @return {unresolved|Boolean}
* @return {unresolved|boolean}
*/
selected: function() {
var selection = this.options.selection;

View File

@ -19,7 +19,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
/**
* Initializes the Focus Manager.
*
* @param {object} options The Focus Manager options.
* @param {Object} options The Focus Manager options.
*
* @since 5.3.0
*
@ -35,7 +35,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
*
* @since 5.3.0
*
* @param {object} event jQuery event object.
* @param {Object} event jQuery event object.
*
* @return {void}
*/
@ -54,7 +54,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
*
* @since 5.3.0
*
* @return {object} A jQuery collection of tabbable elements.
* @return {Object} A jQuery collection of tabbable elements.
*/
getTabbables: function() {
// Skip the file input added by Plupload.
@ -114,7 +114,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
*
* @since 5.2.3
*
* @param {object} visibleElement The jQuery object representing the element that should not be hidden.
* @param {Object} visibleElement The jQuery object representing the element that should not be hidden.
*
* @return {void}
*/
@ -171,7 +171,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
*
* @since 5.2.3
*
* @param {object} element The DOM element that should be checked.
* @param {Object} element The DOM element that should be checked.
*
* @return {boolean} Whether the element should not be hidden from assistive technologies.
*/
@ -218,7 +218,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
*
* @since 5.3.0
*
* @param {object} event jQuery event object.
* @param {Object} event jQuery event object.
*
* @return {void}
*/
@ -242,7 +242,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
*
* @since 5.3.0
*
* @param {object} event jQuery event object.
* @param {Object} event jQuery event object.
*
* @return {void}
*/
@ -278,7 +278,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
*
* @since 5.3.0
*
* @param {object} event jQuery event object.
* @param {Object} event jQuery event object.
*
* @return {void}
*/
@ -329,7 +329,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
*
* @since 5.3.0
*
* @param {object} tab The tab DOM element.
* @param {Object} tab The tab DOM element.
*
* @return {void}
*/

View File

@ -64,7 +64,7 @@ EditorUploader = View.extend(/** @lends wp.media.view.EditorUploader.prototype *
/**
* Check browser support for drag'n'drop.
*
* @return {Boolean}
* @return {boolean}
*/
browserSupport: function() {
var supports = false, div = document.createElement('div');