Utility function namespace
- Source:
Methods
-
<static> areElementListsEqual(listA, listB)
-
Return whether the two lists of elements are the same and are in the same order.
Parameters:
Name Type Description listAArray | jQuery listBArray | jQuery - Since:
-
- 4.1.0
- Source:
Returns:
- Type
- boolean
-
<static> bubbleChildValueChanges(instance, properties)
-
Watch all changes to Value properties, and bubble changes to parent Values instance
Parameters:
Name Type Description instancewp.customize.Class propertiesArray The names of the Value instances to watch. - Since:
-
- 4.1.0
- Source:
-
<static> getCurrentTimestamp()
-
Get current timestamp adjusted for server clock time. Same functionality as the `current_time( 'mysql', false )` function in PHP.
- Since:
-
- 4.9.0
- Source:
Returns:
Current timestamp.- Type
- int
-
<static> getRemainingTime(datetime)
-
Get remaining time of when the date is set.
Parameters:
Name Type Description datetimestring | int | Date Date time or timestamp of the future date. - Since:
-
- 4.9.0
- Source:
Returns:
remainingTime - Remaining time in milliseconds.- Type
- int
-
<static> highlightButton(button [, options])
-
Highlight the existence of a button. This function reminds the user of a button represented by the specified UI element, after an optional delay. If the user focuses the element before the delay passes, the reminder is canceled.
Parameters:
Name Type Argument Description buttonjQuery The element to highlight. optionsobject <optional>
Options. Properties
Name Type Argument Default Description delaynumber <optional>
0 Delay in milliseconds. focusTargetjQuery <optional>
A target for user focus that defaults to the highlighted element. If the user focuses the target before the delay passes, the reminder is canceled. This option exists to accommodate compound buttons containing auxiliary UI, such as the Publish button augmented with a Settings button. - Since:
-
- 4.9.0
- Source:
Returns:
An idempotent function that cancels the reminder.- Type
- function
-
<static> isKeydownButNotEnterEvent(event)
-
Return whether the supplied Event object is for a keydown event but not the Enter key.
Parameters:
Name Type Description eventjQuery.Event - Since:
-
- 4.1.0
- Source:
Returns:
- Type
- boolean
-
<static> parseQueryString(queryString)
-
Parse query string.
Parameters:
Name Type Description queryStringstring Query string. - Since:
-
- 4.7.0
- Source:
Returns:
Parsed query string.- Type
- object
-
<static> prioritySort(a, b)
-
Stable sort for Panels, Sections, and Controls. If a.priority() === b.priority(), then sort by their respective params.instanceNumber.
Parameters:
Name Type Description awp.customize.Panel | wp.customize.Section | wp.customize.Control bwp.customize.Panel | wp.customize.Section | wp.customize.Control - Since:
-
- 4.1.0
- Source:
Returns:
- Type
- Number