Changeset 63456
- Timestamp:
- 09/03/2026 11:26:20 PM (2 months ago)
- Location:
- trunk/src/js/_enqueues/wp/customize
- Files:
-
- 2 edited
-
nav-menus.js (modified) (42 diffs)
-
widgets.js (modified) (42 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/customize/nav-menus.js
r62431 r63456 4 4 5 5 /* global menus, _wpCustomizeNavMenusSettings, wpNavMenu, console */ 6 7 /** 8 * @param {Object} api The Customizer API. 9 * @param {Object} wp The WordPress global object. 10 * @param {JQueryStatic} $ The jQuery object. 11 */ 6 12 ( function( api, wp, $ ) { 7 13 'use strict'; … … 45 51 * @alias wp.customize.Menus.generatePlaceholderAutoIncrementId 46 52 * 47 * @return {number} 53 * @return {number} A negative integer ID. 48 54 */ 49 55 api.Menus.generatePlaceholderAutoIncrementId = function() { … … 96 102 * @alias wp.customize.Menus.insertAutoDraftPost 97 103 * 98 * @param {Object} params -Parameters for the draft post to create.99 * @param {string} params.post_type -Post type to add.100 * @param {string} params.post_title -Post title to use.101 * @return { jQuery.promise} Promise resolved with the added post.104 * @param {Object} params Parameters for the draft post to create. 105 * @param {string} params.post_type Post type to add. 106 * @param {string} params.post_title Post title to use. 107 * @return {JQuery.Promise<*>} Promise resolved with the added post. 102 108 */ 103 109 api.Menus.insertAutoDraftPost = function insertAutoDraftPost( params ) { … … 391 397 * @access private 392 398 * 393 * @param { Array.<Object>} itemTypesList of objects containing type and key.394 * @param {string} deprecated Formerly the object parameter.399 * @param {Object[]} itemTypes List of objects containing type and key. 400 * @param {string} deprecated Formerly the object parameter. 395 401 * @return {void} 396 402 */ … … 631 637 * @private 632 638 * 633 * @param { jQuery.Event} event Event.639 * @param {JQuery.Event} event Event. 634 640 * @return {void} 635 641 */ … … 657 663 * @private 658 664 * 659 * @param { jQuery} container665 * @param {JQuery} container The container of the form for creating the new item. 660 666 * @return {void} 661 667 */ … … 920 926 * @private 921 927 * 922 * @return { Array} Fields (columns) that are hidden.928 * @return {string} Comma separated list of the fields (columns) that are hidden. 923 929 */ 924 930 hidden: function() { … … 946 952 * @since 4.3.0 947 953 * 948 * @param {string} id 949 * @param {Object} options 954 * @param {string} id The ID for the section. 955 * @param {Object} options Options. 950 956 */ 951 957 initialize: function( id, options ) { … … 1015 1021 * Update the active field class for the content container for a given checkbox toggle. 1016 1022 * 1017 * @this { jQuery}1023 * @this {HTMLInputElement} 1018 1024 * @return {void} 1019 1025 */ … … 1142 1148 1143 1149 /** 1144 * @param { Array} themeLocationSlugs Theme location slugs.1150 * @param {string[]} themeLocationSlugs Theme location slugs. 1145 1151 */ 1146 1152 updateAssignedLocationsInSectionTitle: function( themeLocationSlugs ) { … … 1335 1341 * 1336 1342 * @since 4.9.0 1337 * @param {wp.customize.Setting} setting -Added setting.1343 * @param {wp.customize.Setting} setting Added setting. 1338 1344 * @return {void} 1339 1345 */ … … 1349 1355 * 1350 1356 * @since 4.9.0 1351 * @param {wp.customize.Setting} setting -Removed setting.1357 * @param {wp.customize.Setting} setting Removed setting. 1352 1358 * @return {void} 1353 1359 */ … … 1364 1370 updateNoticeVisibility(); 1365 1371 1366 api.Section.prototype.attachEvents. apply( section, arguments);1372 api.Section.prototype.attachEvents.call( section ); 1367 1373 }, 1368 1374 … … 1484 1490 * @since 4.9.0 1485 1491 * 1486 * @param {string|null} locationId -The ID of the location to select. `null` clears all selections.1492 * @param {string|null} locationId The ID of the location to select. `null` clears all selections. 1487 1493 * @return {void} 1488 1494 */ … … 1643 1649 * Shows or hides buttons based on the location of the menu item. 1644 1650 * 1645 * @param {Object} itemToRefresh The menu item that might need its advanced accessibility buttons refreshed 1646 * 1651 * @param {Object} itemToRefresh The menu item that might need its advanced accessibility buttons refreshed. 1652 * 1647 1653 * @since 6.6.0 1648 1654 */ … … 1724 1730 control.renderContent(); 1725 1731 control.deferred.embedded.resolve(); // This triggers control.ready(). 1726 1732 1727 1733 // Mark all menu items as unprocessed. 1728 1734 $( 'button.item-edit' ).data( 'needs_accessibility_refresh', true ); … … 1803 1809 control.params.depth += 1; 1804 1810 } 1805 1811 1806 1812 moveBtn.focus(); // Re-focus after the container was moved. 1807 1813 … … 2037 2043 2038 2044 /** 2039 * 2040 * @return {number} 2045 * Gets the depth of the menu item. 2046 * 2047 * @return {number} The depth of the menu item. 2041 2048 */ 2042 2049 getDepth: function() { … … 2104 2111 2105 2112 /** 2106 * @return {wp.customize.controlConstructor.nav_menu|null} 2113 * Gets the menu control that this menu item belongs to. 2114 * 2115 * @return {wp.customize.Menus.MenuControl|null} The menu control, or null if not found. 2107 2116 */ 2108 2117 getMenuControl: function() { … … 2128 2137 * @since 4.6.0 2129 2138 * 2130 * @param { Boolean} expanded2131 * @param {Object} [params]2132 * @return { Boolean} False if state already applied.2139 * @param {boolean} expanded The new state to apply. 2140 * @param {Object} [params] Object containing options for expand/collapse. 2141 * @return {boolean} False if state already applied. 2133 2142 */ 2134 2143 _toggleExpanded: api.Section.prototype._toggleExpanded, … … 2137 2146 * @since 4.6.0 2138 2147 * 2139 * @param {Object} [params] 2140 * @return { Boolean} False if already expanded.2148 * @param {Object} [params] Object containing options for expansion. 2149 * @return {boolean} False if already expanded. 2141 2150 */ 2142 2151 expand: api.Section.prototype.expand, … … 2147 2156 * @since 4.5.0 Added params.completeCallback. 2148 2157 * 2149 * @param {Object} [params] -Optional params.2150 * @param {Function} [params.completeCallback] -Function to call when the form toggle has finished animating.2158 * @param {Object} [params] Optional params. 2159 * @param {Function} [params.completeCallback] Function to call when the form toggle has finished animating. 2151 2160 */ 2152 2161 expandForm: function( params ) { … … 2157 2166 * @since 4.6.0 2158 2167 * 2159 * @param {Object} [params] 2160 * @return { Boolean} False if already collapsed.2168 * @param {Object} [params] Object containing options for collapse. 2169 * @return {boolean} False if already collapsed. 2161 2170 */ 2162 2171 collapse: api.Section.prototype.collapse, … … 2167 2176 * @since 4.5.0 Added params.completeCallback. 2168 2177 * 2169 * @param {Object} [params] -Optional params.2170 * @param {Function} [params.completeCallback] -Function to call when the form toggle has finished animating.2178 * @param {Object} [params] Optional params. 2179 * @param {Function} [params.completeCallback] Function to call when the form toggle has finished animating. 2171 2180 */ 2172 2181 collapseForm: function( params ) { … … 2180 2189 * @since 4.5.0 Added params.completeCallback. 2181 2190 * 2182 * @param {boolean} [showOrHide] - If not supplied, will be inverse of current visibility2183 * @param {Object} [params] -Optional params.2184 * @param {Function} [params.completeCallback] -Function to call when the form toggle has finished animating.2191 * @param {boolean} [showOrHide] If not supplied, will be inverse of current visibility. 2192 * @param {Object} [params] Optional params. 2193 * @param {Function} [params.completeCallback] Function to call when the form toggle has finished animating. 2185 2194 */ 2186 2195 toggleForm: function( showOrHide, params ) { … … 2199 2208 * 2200 2209 * @since 4.6.0 2201 * @param {boolean} [showOrHide] - If not supplied, will be inverse of current visibility2202 * @param {Object} [params] -Optional params.2203 * @param {Function} [params.completeCallback] -Function to call when the form toggle has finished animating.2210 * @param {boolean} [showOrHide] If not supplied, will be inverse of current visibility. 2211 * @param {Object} [params] Optional params. 2212 * @param {Function} [params.completeCallback] Function to call when the form toggle has finished animating. 2204 2213 */ 2205 2214 onChangeExpanded: function( showOrHide, params ) { … … 2268 2277 * @since 4.5.0 Added params.completeCallback. 2269 2278 * 2270 * @param {Object} [params] -Params object.2271 * @param {Function} [params.completeCallback] -Optional callback function when focus has completed.2279 * @param {Object} [params] Params object. 2280 * @param {Function} [params.completeCallback] Optional callback function when focus has completed. 2272 2281 */ 2273 2282 focus: function( params ) { … … 2339 2348 * @private 2340 2349 * 2341 * @param {number} offset 1|-12350 * @param {number} offset The number of positions to move the item, either 1 or -1. 2342 2351 */ 2343 2352 _changePosition: function( offset ) { … … 2399 2408 * @private 2400 2409 * 2401 * @param {number} offset 1|-12410 * @param {number} offset The number of levels to change the depth by, either 1 or -1. 2402 2411 */ 2403 2412 _changeDepth: function( offset ) { … … 2595 2604 * @since 4.9.0 2596 2605 * 2597 * @param {Object.<string, boolean>} selections -A map of location selections.2606 * @param {Object.<string, boolean>} selections A map of location selections. 2598 2607 * @return {void} 2599 2608 */ … … 2782 2791 * which is called in MenuSection.onChangeExpanded() 2783 2792 * 2784 * @param {Object} menuList -The element that has sortable().2793 * @param {Object} menuList The element that has sortable(). 2785 2794 */ 2786 2795 _setupSortable: function( menuList ) { … … 2984 2993 * Enable/disable the reordering UI 2985 2994 * 2986 * @param {boolean} showOrHide to enable/disable reordering2995 * @param {boolean} showOrHide Whether to enable or disable reordering. 2987 2996 */ 2988 2997 toggleReordering: function( showOrHide ) { … … 3020 3029 3021 3030 /** 3022 * @return {wp.customize.controlConstructor.nav_menu_item[]} 3031 * Get all of the nav_menu_item controls for this menu. 3032 * 3033 * @return {wp.customize.Menus.MenuItemControl[]} The nav_menu_item controls for this menu. 3023 3034 */ 3024 3035 getMenuItemControls: function() { … … 3117 3128 * settings have been updated. 3118 3129 */ 3119 debouncedReflowMenuItems: _.debounce( function( ) {3120 this.reflowMenuItems.apply( this, arg uments );3130 debouncedReflowMenuItems: _.debounce( function( ...args ) { 3131 this.reflowMenuItems.apply( this, args ); 3121 3132 }, 0 ), 3122 3133 … … 3124 3135 * Add a new item to this menu. 3125 3136 * 3126 * @param {Object} item -Value for the nav_menu_item setting to be created.3127 * @return {wp.customize.Menus. controlConstructor.nav_menu_item} The newly-created nav_menu_item control instance.3137 * @param {Object} item Value for the nav_menu_item setting to be created. 3138 * @return {wp.customize.Menus.MenuItemControl} The newly-created nav_menu_item control instance. 3128 3139 */ 3129 3140 addItemToMenu: function( item ) { … … 3190 3201 * @since 4.9.0 3191 3202 * 3192 * @param {wp.customize.controlConstructor.nav_menu_item[]} optionalMenuItemControls 3203 * @param {wp.customize.Menus.MenuItemControl[]} [optionalMenuItemControls] The menu item controls to 3204 * consider. Defaults to all of 3205 * this menu's item controls. 3193 3206 */ 3194 3207 updateInvitationVisibility: function ( optionalMenuItemControls ) { … … 3264 3277 * @alias wp.customize.Menus.applySavedData 3265 3278 * 3266 * @param {Object} data3267 * @param { Array} data.nav_menu_updates3268 * @param { Array} data.nav_menu_item_updates3279 * @param {Object} data Data returned in the customize_save response. 3280 * @param {Object[]} data.nav_menu_updates Result of saving each nav menu, with term_id, previous_term_id, error, status, and saved_value properties. 3281 * @param {Object[]} data.nav_menu_item_updates Result of saving each nav menu item, with post_id, previous_post_id, error, and status properties. 3269 3282 */ 3270 3283 api.Menus.applySavedData = function( data ) { … … 3496 3509 * @alias wp.customize.Menus.focusMenuItemControl 3497 3510 * 3498 * @param {string} menuItemId 3511 * @param {string} menuItemId The ID of the menu item whose control to focus. 3499 3512 */ 3500 3513 api.Menus.focusMenuItemControl = function( menuItemId ) { … … 3510 3523 * @alias wp.customize.Menus.getMenuControl 3511 3524 * 3512 * @param menuId3513 * @return {wp.customize. controlConstructor.menus[]}3525 * @param {string|number} menuId The ID of the menu. 3526 * @return {wp.customize.Menus.MenuControl|undefined} The menu control, or undefined if not found. 3514 3527 */ 3515 3528 api.Menus.getMenuControl = function( menuId ) { … … 3522 3535 * @alias wp.customize.Menus.getMenuItemControl 3523 3536 * 3524 * @param {string} menuItemId 3525 * @return { Object|null}3537 * @param {string} menuItemId The ID of the menu item. 3538 * @return {wp.customize.Menus.MenuItemControl|undefined} The menu item control, or undefined if not found. 3526 3539 */ 3527 3540 api.Menus.getMenuItemControl = function( menuItemId ) { … … 3532 3545 * @alias wp.customize.Menus~menuItemIdToSettingId 3533 3546 * 3534 * @param {string} menuItemId 3547 * @param {string} menuItemId The ID of the menu item. 3548 * @return {string} The setting ID for the menu item. 3535 3549 */ 3536 3550 function menuItemIdToSettingId( menuItemId ) { … … 3544 3558 * @alias wp.customize.Menus~displayNavMenuName 3545 3559 * 3546 * @param {string} name3547 * @return {string} 3560 * @param {string} [name] The menu name. 3561 * @return {string} The sanitized display name, or a fallback "unnamed" string if empty. 3548 3562 */ 3549 3563 function displayNavMenuName( name ) { -
trunk/src/js/_enqueues/wp/customize/widgets.js
r58455 r63456 4 4 5 5 /* global _wpCustomizeWidgetsSettings */ 6 7 /** 8 * @param {Object} wp The WordPress global object. 9 * @param {JQueryStatic} $ The jQuery object. 10 */ 6 11 (function( wp, $ ){ 7 12 … … 252 257 /** 253 258 * Updates the count of the available widgets that have the `search_matched` attribute. 254 */259 */ 255 260 updateSearchMatchesCount: function() { 256 261 this.searchMatchesCount = this.collection.where({ search_matched: true }).length; … … 272 277 /** 273 278 * Changes visibility of available widgets. 274 */279 */ 275 280 updateList: function() { 276 281 this.collection.each( function( widget ) { … … 285 290 /** 286 291 * Highlights a widget. 287 */ 292 * 293 * @param {JQuery} widgetTpl The widget template to highlight. 294 */ 288 295 select: function( widgetTpl ) { 289 296 this.selected = $( widgetTpl ); … … 294 301 /** 295 302 * Highlights a widget on focus. 303 * 304 * @param {JQuery.Event} event The focus event. 296 305 */ 297 306 focus: function( event ) { … … 301 310 /** 302 311 * Handles submit for keypress and click on widget. 312 * 313 * @param {JQuery.Event} event The keypress or click event. 303 314 */ 304 315 _submit: function( event ) { … … 313 324 /** 314 325 * Adds a selected widget to the sidebar. 315 */ 326 * 327 * @param {JQuery} widgetTpl The widget template to add. 328 */ 316 329 submit: function( widgetTpl ) { 317 330 var widgetId, widget, widgetFormControl; … … 343 356 /** 344 357 * Opens the panel. 358 * 359 * @param {wp.customize.Widgets.SidebarControl} sidebarControl The sidebar control that opened the panel. 345 360 */ 346 361 open: function( sidebarControl ) { … … 372 387 /** 373 388 * Closes the panel. 389 * 390 * @param {Object} [options] Options for closing the panel. 374 391 */ 375 392 close: function( options ) { … … 390 407 /** 391 408 * Adds keyboard accessibility to the panel. 409 * 410 * @param {JQuery.Event} event The keydown event. 392 411 */ 393 412 keyboardAccessible: function( event ) { … … 458 477 459 478 /** 460 * @param { jQuery.Event} e461 * @param { jQuery} widget462 * @param {string} newForm479 * @param {JQuery.Event} e The widget-synced event. 480 * @param {JQuery} widget The widget root element. 481 * @param {string} newForm The HTML for the updated widget form. 463 482 */ 464 483 rss: function( e, widget, newForm ) { … … 492 511 * @constructs wp.customize.Widgets.WidgetControl 493 512 * @augments wp.customize.Control 513 * 514 * @param {string} id Control ID. 515 * @param {Object} options Control options. 494 516 */ 495 517 initialize: function( id, options ) { … … 745 767 746 768 /** 747 * select the provided sidebar list item in the move widget area769 * Selects the provided sidebar list item in the move widget area. 748 770 * 749 * @param { jQuery} li771 * @param {JQuery} li The sidebar list item to select. 750 772 */ 751 773 selectSidebarItem = function( li ) { … … 954 976 formSyncHandler = api.Widgets.formSyncHandlers[ this.params.widget_id_base ]; 955 977 if ( formSyncHandler ) { 956 $( document ).on( 'widget-synced', function( e, widget ) {978 $( document ).on( 'widget-synced', function( e, widget, ...args ) { 957 979 if ( $widgetRoot.is( widget ) ) { 958 formSyncHandler. apply( document, arguments );980 formSyncHandler.call( document, e, widget, ...args ); 959 981 } 960 982 } ); … … 969 991 * @since 4.1.0 970 992 * 971 * @param {boolean} active972 * @param {Object} args973 * @param { function} args.completeCallback993 * @param {boolean} active Whether the widget is rendered. 994 * @param {Object} args Args. 995 * @param {Function} args.completeCallback Function to call once the class has been toggled. 974 996 */ 975 997 onChangeActive: function ( active, args ) { … … 1040 1062 * over when copying sanitized values over to the form loaded. 1041 1063 * 1042 * @param { jQuery} container element in which to look for inputs1043 * @return { jQuery} inputs1064 * @param {JQuery} container Element in which to look for inputs. 1065 * @return {JQuery} The inputs found within the container. 1044 1066 * @private 1045 1067 */ … … 1052 1074 * This string can be used to compare whether or not the form has all of the same fields. 1053 1075 * 1054 * @param { jQuery} inputs1055 * @return {string} 1076 * @param {JQuery} inputs The inputs to build a signature from. 1077 * @return {string} Signature string for the inputs. 1056 1078 * @private 1057 1079 */ … … 1075 1097 * Get the state for an input depending on its type. 1076 1098 * 1077 * @param { jQuery|Element} input1078 * @return {string|boolean| Array|*}1099 * @param {JQuery|Element} input The input to read the state from. 1100 * @return {string|boolean|string[]|*} State of the input. 1079 1101 * @private 1080 1102 */ … … 1095 1117 * Update an input's state based on its type. 1096 1118 * 1097 * @param { jQuery|Element} input1098 * @param {string|boolean| Array|*} state1119 * @param {JQuery|Element} input The input element to update. 1120 * @param {string|boolean|string[]|*} state The state to apply: the checked state for checkboxes and radio buttons, an array of values for multi-selects, and otherwise the input's value. 1099 1121 * @private 1100 1122 */ … … 1125 1147 1126 1148 /** 1127 * @return {wp.customize.controlConstructor.sidebar_widgets[]} 1149 * Get the sidebar widgets control for the sidebar this widget is in. 1150 * 1151 * @return {wp.customize.Widgets.SidebarControl|undefined} The sidebar widgets control, or undefined if not found. 1128 1152 */ 1129 1153 getSidebarWidgetsControl: function() { … … 1144 1168 * along with the new widget control form to render. 1145 1169 * 1146 * @param {Object} [args]1147 * @param {Object|null} [args.instance=null] When the model changes, the instance is sent here; otherwise, the inputs from the form are used1148 * @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.1149 * @param {boolean} [args.ignoreActiveElement=false] Whether or not updating a field will be deferred if focus is still on the element.1170 * @param {Object} [args] Arguments for the update. 1171 * @param {Object|null} [args.instance=null] When the model changes, the instance is sent here; otherwise, the inputs from the form are used. 1172 * @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. 1173 * @param {boolean} [args.ignoreActiveElement=false] Whether or not updating a field will be deferred if focus is still on the element. 1150 1174 */ 1151 1175 updateWidget: function( args ) { … … 1342 1366 * @since 4.1.0 1343 1367 * 1344 * @param { Boolean} expanded1345 * @param {Object} [params]1346 * @return { Boolean} False if state already applied.1368 * @param {boolean} expanded The new state to apply. 1369 * @param {Object} [params] Object containing options for expand/collapse. 1370 * @return {boolean} False if state already applied. 1347 1371 */ 1348 1372 _toggleExpanded: api.Section.prototype._toggleExpanded, … … 1351 1375 * @since 4.1.0 1352 1376 * 1353 * @param {Object} [params] 1354 * @return { Boolean} False if already expanded.1377 * @param {Object} [params] Object containing options for expansion. 1378 * @return {boolean} False if already expanded. 1355 1379 */ 1356 1380 expand: api.Section.prototype.expand, … … 1368 1392 * @since 4.1.0 1369 1393 * 1370 * @param {Object} [params] 1371 * @return { Boolean} False if already collapsed.1394 * @param {Object} [params] Object containing options for collapse. 1395 * @return {boolean} False if already collapsed. 1372 1396 */ 1373 1397 collapse: api.Section.prototype.collapse, … … 1387 1411 * @deprecated this is poor naming, and it is better to directly set control.expanded( showOrHide ) 1388 1412 * 1389 * @param {boolean|undefined} [showOrHide] If not supplied, will be inverse of current visibility 1413 * @param {boolean|undefined} [showOrHide] If not supplied, will be inverse of current visibility. 1390 1414 */ 1391 1415 toggleForm: function( showOrHide ) { … … 1399 1423 * Respond to change in the expanded state. 1400 1424 * 1401 * @param {boolean} expanded 1402 * @param {Object} args merged on top of this.defaultActiveArguments 1425 * @param {boolean} expanded The expanded state to transition to. 1426 * @param {Object} args Object containing options for expand/collapse, merged on top of this.defaultExpandedArguments. 1427 * @param {boolean} [args.unchanged] Whether the expanded state is unchanged. 1428 * @param {Function} args.completeCallback Callback to be executed once the expand/collapse action is complete. 1403 1429 */ 1404 1430 onChangeExpanded: function ( expanded, args ) { … … 1499 1525 * Get the position (index) of the widget in the containing sidebar 1500 1526 * 1501 * @return {number }1527 * @return {number|void} Index of the widget in the sidebar, or undefined if not found. 1502 1528 */ 1503 1529 getWidgetSidebarPosition: function() { … … 1531 1557 * @private 1532 1558 * 1533 * @param {number} offset 1|-11559 * @param {number} offset The number of positions to move the widget, either 1 or -1. 1534 1560 */ 1535 1561 _moveWidgetByOne: function( offset ) { … … 1550 1576 * Toggle visibility of the widget move area 1551 1577 * 1552 * @param {boolean} [showOrHide] 1578 * @param {boolean} [showOrHide] If not supplied, will be inverse of current visibility. 1553 1579 */ 1554 1580 toggleWidgetMoveArea: function( showOrHide ) { … … 1606 1632 * @augments wp.customize.Panel 1607 1633 */ 1608 api.Widgets.WidgetsPanel = api.Panel.extend(/** @lends wp.customize.Widgets.Wi getsPanel.prototype */{1634 api.Widgets.WidgetsPanel = api.Panel.extend(/** @lends wp.customize.Widgets.WidgetsPanel.prototype */{ 1609 1635 1610 1636 /** … … 1643 1669 * Determine whether or not the notice should be displayed. 1644 1670 * 1645 * @return {boolean} 1671 * @return {boolean} True if the notice should be displayed, false otherwise. 1646 1672 */ 1647 1673 shouldShowNotice = function() { … … 1713 1739 * @since 4.4.0 1714 1740 * 1715 * @return {boolean} 1741 * @return {boolean} True if the panel is contextually active, false otherwise. 1716 1742 */ 1717 1743 isContextuallyActive: function() { … … 2009 2035 * Enable/disable the reordering UI 2010 2036 * 2011 * @param {boolean} showOrHide to enable/disable reordering2037 * @param {boolean} showOrHide Whether to enable or disable reordering. 2012 2038 * 2013 2039 * @todo We should have a reordering state instead and rename this to onChangeReordering … … 2049 2075 * 2050 2076 * @since 3.9.0 2051 * @return {wp.customize. controlConstructor.widget_form[]}2077 * @return {wp.customize.Widgets.WidgetControl[]} Widget form controls associated with the current sidebar. 2052 2078 */ 2053 2079 getWidgetFormControls: function() { … … 2066 2092 2067 2093 /** 2068 * @param {string} widgetId or an id_base for adding a previously non-existing widget. 2069 * @return {Object|false} widget_form control instance, or false on error. 2094 * Add a widget to the sidebar. 2095 * 2096 * @param {string} widgetId Widget ID, or an id_base for adding a previously non-existing widget. 2097 * @return {wp.customize.Widgets.WidgetControl|false} The widget_form control instance, or false on error. 2070 2098 */ 2071 2099 addWidget: function( widgetId ) { … … 2222 2250 * Highlight a widget control. 2223 2251 * 2224 * @param {string} widgetId 2252 * @param {string} widgetId The ID of the widget to highlight. 2225 2253 */ 2226 2254 api.Widgets.highlightWidgetFormControl = function( widgetId ) { … … 2235 2263 * Focus a widget control. 2236 2264 * 2237 * @param {string} widgetId 2265 * @param {string} widgetId The ID of the widget to focus. 2238 2266 */ 2239 2267 api.Widgets.focusWidgetFormControl = function( widgetId ) { … … 2247 2275 /** 2248 2276 * Given a widget control, find the sidebar widgets control that contains it. 2249 * @param {string} widgetId 2250 * @return {Object|null} 2277 * @param {string} widgetId The ID of the widget to find the sidebar widgets control for. 2278 * @return {Object|null} Sidebar widgets control that contains the widget, or null if not found. 2251 2279 */ 2252 2280 api.Widgets.getSidebarWidgetControlContainingWidget = function( widgetId ) { … … 2266 2294 * Given a widget ID for a widget appearing in the preview, get the widget form control associated with it. 2267 2295 * 2268 * @param {string} widgetId 2269 * @return {Object|null} 2296 * @param {string} widgetId The ID of the widget to find the form control for. 2297 * @return {Object|null} Widget form control associated with the widget, or null if not found. 2270 2298 */ 2271 2299 api.Widgets.getWidgetFormControlForWidget = function( widgetId ) { … … 2320 2348 * This overrides the back button to serve the purpose of breadcrumb navigation. 2321 2349 * 2322 * @param {wp.customize.Section|wp.customize.Panel|wp.customize.Control} focusConstruct -The object to initially focus.2323 * @param {wp.customize.Section|wp.customize.Panel|wp.customize.Control} returnConstruct -The object to return focus.2350 * @param {wp.customize.Section|wp.customize.Panel|wp.customize.Control} focusConstruct The object to initially focus. 2351 * @param {wp.customize.Section|wp.customize.Panel|wp.customize.Control} returnConstruct The object to return focus. 2324 2352 */ 2325 2353 function focusConstructWithBreadcrumb( focusConstruct, returnConstruct ) { … … 2335 2363 2336 2364 /** 2337 * @param {string} widgetId 2338 * @return {Object} 2365 * @param {string} widgetId The widget ID to parse. 2366 * @return {Object} Parsed widget ID with id_base and number properties. 2339 2367 */ 2340 2368 function parseWidgetId( widgetId ) { … … 2357 2385 2358 2386 /** 2359 * @param {string} widgetId 2360 * @return {string} settingId2387 * @param {string} widgetId The widget ID. 2388 * @return {string} The setting ID for the widget. 2361 2389 */ 2362 2390 function widgetIdToSettingId( widgetId ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)