class WP_Script_Modules {
/**
* Holds the registered script modules, keyed by script module identifier.
*
* @since 6.5.0
* @var array<string, array<string, mixed>>
*/
private $registered = array();
/**
* An array of IDs for queued script modules.
*
* @since 6.9.0
* @var string[]
*/
private $queue = array();
/**
* Holds the script module identifiers that have been printed.
*
* @since 6.9.0
* @var string[]
*/
private $done = array();
/**
* Tracks whether the @wordpress/a11y script module is available.
*
* Some additional HTML is required on the page for the module to work. Track
* whether it's available to print at the appropriate time.
*
* @since 6.7.0
* @var bool
*/
private $a11y_available = false;
/**
* Holds a mapping of dependents (as IDs) for a given script ID.
* Used to optimize recursive dependency tree checks.
*
* @since 6.9.0
* @var array<string, string[]>
*/
private $dependents_map = array();
/**
* Holds the valid values for fetchpriority.
*
* @since 6.9.0
* @var string[]
*/
private $priorities = array(
'low',
'auto',
'high',
);
/**
* List of IDs for script modules encountered which have missing dependencies.
*
* An ID is added to this list when it is discovered to have missing dependencies. At this time, a warning is
* emitted with _doing_it_wrong(). The ID is then added to this list, so that duplicate warnings don't occur.
*
* @since 6.9.1
* @var string[]
*/
private $modules_with_missing_dependencies = array();
/**
* Registers the script module if no script module with that script module
* identifier has already been registered.
*
* @since 6.5.0
* @since 6.9.0 Added the $args parameter.
*
* @param string $id The identifier of the script module. Should be unique. It will be used in the
* final import map.
* @param string $src Optional. Full URL of the script module, or path of the script module relative
* to the WordPress root directory. If it is provided and the script module has
* not been registered yet, it will be registered.
* @param array $deps {
* Optional. List of dependencies.
*
* @type string|array ...$0 {
* An array of script module identifiers of the dependencies of this script
* module. The dependencies can be strings or arrays. If they are arrays,
* they need an `id` key with the script module identifier, and can contain
* an `import` key with either `static` or `dynamic`. By default,
* dependencies that don't contain an `import` key are considered static.
*
* @type string $id The script module identifier.
* @type string $import Optional. Import type. May be either `static` or
* `dynamic`. Defaults to `static`.
* }
* }
* @param string|false|null $version Optional. String specifying the script module version number. Defaults to false.
* It is added to the URL as a query string for cache busting purposes. If $version
* is set to false, the version number is the currently installed WordPress version.
* If $version is set to null, no version is added.
* @param array $args {
* Optional. An array of additional args. Default empty array.
*
* @type bool $in_footer Whether to print the script module in the footer. Only relevant to block themes. Default 'false'. Optional.
* @type 'auto'|'low'|'high' $fetchpriority Fetch priority. Default 'auto'. Optional.
* }
*/
public function register( string $id, string $src, array $deps = array(), $version = false, array $args = array() ) {
if ( '' === $id ) {
_doing_it_wrong( __METHOD__, __( 'Non-empty string required for id.' ), '6.9.0' );
return;
}
if ( ! isset( $this->registered[ $id ] ) ) {
$dependencies = array();
foreach ( $deps as $dependency ) {
if ( is_array( $dependency ) ) {
if ( ! isset( $dependency['id'] ) || ! is_string( $dependency['id'] ) ) {
_doing_it_wrong( __METHOD__, __( 'Missing required id key in entry among dependencies array.' ), '6.5.0' );
continue;
}
$dependencies[] = array(
'id' => $dependency['id'],
'import' => isset( $dependency['import'] ) && 'dynamic' === $dependency['import'] ? 'dynamic' : 'static',
);
} elseif ( is_string( $dependency ) ) {
$dependencies[] = array(
'id' => $dependency,
'import' => 'static',
);
} else {
_doing_it_wrong( __METHOD__, __( 'Entries in dependencies array must be either strings or arrays with an id key.' ), '6.5.0' );
}
}
$in_footer = isset( $args['in_footer'] ) && (bool) $args['in_footer'];
$fetchpriority = 'auto';
if ( isset( $args['fetchpriority'] ) ) {
if ( $this->is_valid_fetchpriority( $args['fetchpriority'] ) ) {
$fetchpriority = $args['fetchpriority'];
} else {
_doing_it_wrong(
__METHOD__,
sprintf(
/* translators: 1: $fetchpriority, 2: $id */
__( 'Invalid fetchpriority `%1$s` defined for `%2$s` during script registration.' ),
is_string( $args['fetchpriority'] ) ? $args['fetchpriority'] : gettype( $args['fetchpriority'] ),
$id
),
'6.9.0'
);
}
}
$this->registered[ $id ] = array(
'src' => $src,
'version' => $version,
'dependencies' => $dependencies,
'in_footer' => $in_footer,
'fetchpriority' => $fetchpriority,
);
}
}
/**
* Gets IDs for queued script modules.
*
* @since 6.9.0
*
* @return string[] Script module IDs.
*/
public function get_queue(): array {
return $this->queue;
}
/**
* Checks if the provided fetchpriority is valid.
*
* @since 6.9.0
*
* @param string|mixed $priority Fetch priority.
* @return bool Whether valid fetchpriority.
*/
private function is_valid_fetchpriority( $priority ): bool {
return in_array( $priority, $this->priorities, true );
}
/**
* Sets the fetch priority for a script module.
*
* @since 6.9.0
*
* @param string $id Script module identifier.
* @param 'auto'|'low'|'high' $priority Fetch priority for the script module.
* @return bool Whether setting the fetchpriority was successful.
*/
public function set_fetchpriority( string $id, string $priority ): bool {
if ( ! isset( $this->registered[ $id ] ) ) {
return false;
}
if ( '' === $priority ) {
$priority = 'auto';
}
if ( ! $this->is_valid_fetchpriority( $priority ) ) {
_doing_it_wrong(
__METHOD__,
/* translators: %s: Invalid fetchpriority. */
sprintf( __( 'Invalid fetchpriority: %s' ), $priority ),
'6.9.0'
);
return false;
}
$this->registered[ $id ]['fetchpriority'] = $priority;
return true;
}
/**
* Sets whether a script module should be printed in the footer.
*
* This is only relevant in block themes.
*
* @since 6.9.0
*
* @param string $id Script module identifier.
* @param bool $in_footer Whether to print in the footer.
* @return bool Whether setting the printing location was successful.
*/
public function set_in_footer( string $id, bool $in_footer ): bool {
if ( ! isset( $this->registered[ $id ] ) ) {
return false;
}
$this->registered[ $id ]['in_footer'] = $in_footer;
return true;
}
/**
* Marks the script module to be enqueued in the page.
*
* If a src is provided and the script module has not been registered yet, it
* will be registered.
*
* @since 6.5.0
* @since 6.9.0 Added the $args parameter.
*
* @param string $id The identifier of the script module. Should be unique. It will be used in the
* final import map.
* @param string $src Optional. Full URL of the script module, or path of the script module relative
* to the WordPress root directory. If it is provided and the script module has
* not been registered yet, it will be registered.
* @param array $deps {
* Optional. List of dependencies.
*
* @type string|array ...$0 {
* An array of script module identifiers of the dependencies of this script
* module. The dependencies can be strings or arrays. If they are arrays,
* they need an `id` key with the script module identifier, and can contain
* an `import` key with either `static` or `dynamic`. By default,
* dependencies that don't contain an `import` key are considered static.
*
* @type string $id The script module identifier.
* @type string $import Optional. Import type. May be either `static` or
* `dynamic`. Defaults to `static`.
* }
* }
* @param string|false|null $version Optional. String specifying the script module version number. Defaults to false.
* It is added to the URL as a query string for cache busting purposes. If $version
* is set to false, the version number is the currently installed WordPress version.
* If $version is set to null, no version is added.
* @param array $args {
* Optional. An array of additional args. Default empty array.
*
* @type bool $in_footer Whether to print the script module in the footer. Only relevant to block themes. Default 'false'. Optional.
* @type 'auto'|'low'|'high' $fetchpriority Fetch priority. Default 'auto'. Optional.
* }
*/
public function enqueue( string $id, string $src="/?originalUrl=https%3A%2F%2Fdeveloper.wordpress.org%2F%26%23039%3B%26%23039%3B%2C%2520array%2520%24deps%2520%3D%2520array()%2C%2520%24version%2520%3D%2520false%2C%2520array%2520%24args%2520%3D%2520array()%2520)%2520%7Bif%2520(%2520%26%23039%3B%26%23039%3B%2520%3D%3D%3D%2520%24id%2520)%2520%7B_doing_it_wrong(%2520__METHOD__%2C%2520__(%2520%26%23039%3BNon-empty%2520string%2520required%2520for%2520id.%26%23039%3B%2520)%2C%2520%26%23039%3B6.9.0%26%23039%3B%2520)%3Breturn%3B%7Dif%2520(%2520!%2520in_array(%2520%24id%2C%2520%24this-%26gt%3Bqueue%2C%2520true%2520)%2520)%2520%7B%24this-%26gt%3Bqueue%5B%5D%2520%3D%2520%24id%3B%7Dif%2520(%2520!%2520isset(%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%2520)%2520%26amp%3B%26amp%3B%2520%24src%2520)%2520%7B%24this-%26gt%3Bregister(%2520%24id%2C%2520%24src%2C%2520%24deps%2C%2520%24version%2C%2520%24args%2520)%3B%7D%7D%2F**%2520*%2520Unmarks%2520the%2520script%2520module%2520so%2520it%2520will%2520no%2520longer%2520be%2520enqueued%2520in%2520the%2520page.%2520*%2520*%2520%40since%25206.5.0%2520*%2520*%2520%40param%2520string%2520%24id%2520The%2520identifier%2520of%2520the%2520script%2520module.%2520*%2Fpublic%2520function%2520dequeue(%2520string%2520%24id%2520)%2520%7B%24this-%26gt%3Bqueue%2520%3D%2520array_values(%2520array_diff(%2520%24this-%26gt%3Bqueue%2C%2520array(%2520%24id%2520)%2520)%2520)%3B%7D%2F**%2520*%2520Removes%2520a%2520registered%2520script%2520module.%2520*%2520*%2520%40since%25206.5.0%2520*%2520*%2520%40param%2520string%2520%24id%2520The%2520identifier%2520of%2520the%2520script%2520module.%2520*%2Fpublic%2520function%2520deregister(%2520string%2520%24id%2520)%2520%7B%24this-%26gt%3Bdequeue(%2520%24id%2520)%3Bunset(%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%2520)%3B%7D%2F**%2520*%2520Adds%2520the%2520hooks%2520to%2520print%2520the%2520import%2520map%2C%2520enqueued%2520script%2520modules%2520and%2520script%2520*%2520module%2520preloads.%2520*%2520*%2520In%2520classic%2520themes%2C%2520the%2520script%2520modules%2520used%2520by%2520the%2520blocks%2520are%2520not%2520yet%2520known%2520*%2520when%2520the%2520%2560wp_head%2560%2520actions%2520is%2520fired%2C%2520so%2520it%2520needs%2520to%2520print%2520everything%2520in%2520the%2520*%2520footer.%2520*%2520*%2520%40since%25206.5.0%2520*%2Fpublic%2520function%2520add_hooks()%2520%7B%24is_block_theme%2520%3D%2520wp_is_block_theme()%3B%24position%2520%2520%2520%2520%2520%2520%2520%3D%2520%24is_block_theme%2520%3F%2520%26%23039%3Bwp_head%26%23039%3B%2520%3A%2520%26%23039%3Bwp_footer%26%23039%3B%3Badd_action(%2520%24position%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_import_map%26%23039%3B%2520)%2520)%3Bif%2520(%2520%24is_block_theme%2520)%2520%7B%2F*%2520*%2520Modules%2520can%2520only%2520be%2520printed%2520in%2520the%2520head%2520for%2520block%2520themes%2520because%2520only%2520with%2520*%2520block%2520themes%2520will%2520import%2520map%2520be%2520fully%2520populated%2520by%2520modules%2520discovered%2520by%2520*%2520rendering%2520the%2520block%2520template.%2520In%2520classic%2520themes%2C%2520modules%2520are%2520enqueued%2520during%2520*%2520template%2520rendering%2C%2520thus%2520the%2520import%2520map%2520must%2520be%2520printed%2520in%2520the%2520footer%2C%2520*%2520followed%2520by%2520all%2520enqueued%2520modules.%2520*%2Fadd_action(%2520%26%23039%3Bwp_head%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_head_enqueued_script_modules%26%23039%3B%2520)%2520)%3B%7Dadd_action(%2520%26%23039%3Bwp_footer%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_enqueued_script_modules%26%23039%3B%2520)%2520)%3Badd_action(%2520%24position%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_script_module_preloads%26%23039%3B%2520)%2520)%3Badd_action(%2520%26%23039%3Badmin_print_footer_scripts%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_import_map%26%23039%3B%2520)%2520)%3Badd_action(%2520%26%23039%3Badmin_print_footer_scripts%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_enqueued_script_modules%26%23039%3B%2520)%2520)%3Badd_action(%2520%26%23039%3Badmin_print_footer_scripts%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_script_module_preloads%26%23039%3B%2520)%2520)%3Badd_action(%2520%26%23039%3Bwp_footer%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_script_module_data%26%23039%3B%2520)%2520)%3Badd_action(%2520%26%23039%3Badmin_print_footer_scripts%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_script_module_data%26%23039%3B%2520)%2520)%3Badd_action(%2520%26%23039%3Bwp_footer%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_a11y_script_module_html%26%23039%3B%2520)%2C%252020%2520)%3Badd_action(%2520%26%23039%3Badmin_print_footer_scripts%26%23039%3B%2C%2520array(%2520%24this%2C%2520%26%23039%3Bprint_a11y_script_module_html%26%23039%3B%2520)%2C%252020%2520)%3B%7D%2F**%2520*%2520Gets%2520the%2520highest%2520fetch%2520priority%2520for%2520the%2520provided%2520script%2520IDs.%2520*%2520*%2520%40since%25206.9.0%2520*%2520*%2520%40param%2520string%5B%5D%2520%24ids%2520Script%2520module%2520IDs.%2520*%2520%40return%2520%26%23039%3Bauto%26%23039%3B%7C%26%23039%3Blow%26%23039%3B%7C%26%23039%3Bhigh%26%23039%3B%2520Highest%2520fetch%2520priority%2520for%2520the%2520provided%2520script%2520module%2520IDs.%2520*%2Fprivate%2520function%2520get_highest_fetchpriority(%2520array%2520%24ids%2520)%3A%2520string%2520%7Bstatic%2520%24high_priority_index%2520%3D%2520null%3Bif%2520(%2520null%2520%3D%3D%3D%2520%24high_priority_index%2520)%2520%7B%24high_priority_index%2520%3D%2520count(%2520%24this-%26gt%3Bpriorities%2520)%2520-%25201%3B%7D%24highest_priority_index%2520%3D%25200%3Bforeach%2520(%2520%24ids%2520as%2520%24id%2520)%2520%7Bif%2520(%2520isset(%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%2520)%2520)%2520%7B%24highest_priority_index%2520%3D%2520(int)%2520max(%24highest_priority_index%2C(int)%2520array_search(%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%5B%26%23039%3Bfetchpriority%26%23039%3B%5D%2C%2520%24this-%26gt%3Bpriorities%2C%2520true%2520))%3Bif%2520(%2520%24high_priority_index%2520%3D%3D%3D%2520%24highest_priority_index%2520)%2520%7Bbreak%3B%7D%7D%7Dreturn%2520%24this-%26gt%3Bpriorities%5B%2520%24highest_priority_index%2520%5D%3B%7D%2F**%2520*%2520Prints%2520the%2520enqueued%2520script%2520modules%2520in%2520head.%2520*%2520*%2520This%2520is%2520only%2520used%2520in%2520block%2520themes.%2520*%2520*%2520%40since%25206.9.0%2520*%2Fpublic%2520function%2520print_head_enqueued_script_modules()%2520%7Bforeach%2520(%2520%24this-%26gt%3Bget_sorted_dependencies(%2520%24this-%26gt%3Bqueue%2520)%2520as%2520%24id%2520)%2520%7Bif%2520(isset(%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%2520)%2520%26amp%3B%26amp%3B!%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%5B%26%23039%3Bin_footer%26%23039%3B%5D)%2520%7B%2F%2F%2520If%2520any%2520dependency%2520is%2520set%2520to%2520be%2520printed%2520in%2520footer%2C%2520skip%2520printing%2520this%2520module%2520in%2520head.%24dependencies%2520%3D%2520array_keys(%2520%24this-%26gt%3Bget_dependencies(%2520array(%2520%24id%2520)%2520)%2520)%3Bforeach%2520(%2520%24dependencies%2520as%2520%24dependency_id%2520)%2520%7Bif%2520(in_array(%2520%24dependency_id%2C%2520%24this-%26gt%3Bqueue%2C%2520true%2520)%2520%26amp%3B%26amp%3Bisset(%2520%24this-%26gt%3Bregistered%5B%2520%24dependency_id%2520%5D%2520)%2520%26amp%3B%26amp%3B%24this-%26gt%3Bregistered%5B%2520%24dependency_id%2520%5D%5B%26%23039%3Bin_footer%26%23039%3B%5D)%2520%7Bcontinue%25202%3B%7D%7D%24this-%26gt%3Bprint_script_module(%2520%24id%2520)%3B%7D%7D%7D%2F**%2520*%2520Prints%2520the%2520enqueued%2520script%2520modules%2520in%2520footer.%2520*%2520*%2520%40since%25206.5.0%2520*%2Fpublic%2520function%2520print_enqueued_script_modules()%2520%7Bforeach%2520(%2520%24this-%26gt%3Bget_sorted_dependencies(%2520%24this-%26gt%3Bqueue%2520)%2520as%2520%24id%2520)%2520%7B%24this-%26gt%3Bprint_script_module(%2520%24id%2520)%3B%7D%7D%2F**%2520*%2520Prints%2520the%2520enqueued%2520script%2520module%2520using%2520script%2520tags%2520with%2520type%3D%26quot%3Bmodule%26quot%3B%2520*%2520attributes.%2520*%2520*%2520%40since%25206.9.0%2520*%2520*%2520%40param%2520string%2520%24id%2520The%2520script%2520module%2520identifier.%2520*%2Fprivate%2520function%2520print_script_module(%2520string%2520%24id%2520)%2520%7Bif%2520(%2520in_array(%2520%24id%2C%2520%24this-%26gt%3Bdone%2C%2520true%2520)%2520%7C%7C%2520!%2520in_array(%2520%24id%2C%2520%24this-%26gt%3Bqueue%2C%2520true%2520)%2520)%2520%7Breturn%3B%7D%24this-%26gt%3Bdone%5B%5D%2520%3D%2520%24id%3B%24src%2520%3D%2520%24this-%26gt%3Bget_src(%2520%24id%2520)%3Bif%2520(%2520%26%23039%3B%26%23039%3B%2520%3D%3D%3D%2520%24src%2520)%2520%7Breturn%3B%7D%24attributes%2520%3D%2520array(%26%23039%3Btype%26%23039%3B%2520%3D%26gt%3B%2520%26%23039%3Bmodule%26%23039%3B%2C%26%23039%3Bsrc%26%23039%3B%2520%2520%3D%26gt%3B%2520%24src%2C%26%23039%3Bid%26%23039%3B%2520%2520%2520%3D%26gt%3B%2520%24id%2520.%2520%26%23039%3B-js-module%26%23039%3B%2C)%3B%24script_module%2520%2520%2520%2520%2520%3D%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%3B%24queued_dependents%2520%3D%2520array_intersect(%2520%24this-%26gt%3Bqueue%2C%2520%24this-%26gt%3Bget_recursive_dependents(%2520%24id%2520)%2520)%3B%24fetchpriority%2520%2520%2520%2520%2520%3D%2520%24this-%26gt%3Bget_highest_fetchpriority(%2520array_merge(%2520array(%2520%24id%2520)%2C%2520%24queued_dependents%2520)%2520)%3Bif%2520(%2520%26%23039%3Bauto%26%23039%3B%2520!%3D%3D%2520%24fetchpriority%2520)%2520%7B%24attributes%5B%26%23039%3Bfetchpriority%26%23039%3B%5D%2520%3D%2520%24fetchpriority%3B%7Dif%2520(%2520%24fetchpriority%2520!%3D%3D%2520%24script_module%5B%26%23039%3Bfetchpriority%26%23039%3B%5D%2520)%2520%7B%24attributes%5B%26%23039%3Bdata-wp-fetchpriority%26%23039%3B%5D%2520%3D%2520%24script_module%5B%26%23039%3Bfetchpriority%26%23039%3B%5D%3B%7Dwp_print_script_tag(%2520%24attributes%2520)%3B%7D%2F**%2520*%2520Prints%2520the%2520static%2520dependencies%2520of%2520the%2520enqueued%2520script%2520modules%2520using%2520*%2520link%2520tags%2520with%2520rel%3D%26quot%3Bmodulepreload%26quot%3B%2520attributes.%2520*%2520*%2520If%2520a%2520script%2520module%2520is%2520marked%2520for%2520enqueue%2C%2520it%2520will%2520not%2520be%2520preloaded.%2520*%2520*%2520%40since%25206.5.0%2520*%2Fpublic%2520function%2520print_script_module_preloads()%2520%7B%24dependency_ids%2520%3D%2520%24this-%26gt%3Bget_sorted_dependencies(%2520%24this-%26gt%3Bqueue%2C%2520array(%2520%26%23039%3Bstatic%26%23039%3B%2520)%2520)%3Bforeach%2520(%2520%24dependency_ids%2520as%2520%24id%2520)%2520%7B%2F%2F%2520Don%26%23039%3Bt%2520preload%2520if%2520it%26%23039%3Bs%2520marked%2520for%2520enqueue.if%2520(%2520in_array(%2520%24id%2C%2520%24this-%26gt%3Bqueue%2C%2520true%2520)%2520)%2520%7Bcontinue%3B%7D%24src%2520%3D%2520%24this-%26gt%3Bget_src(%2520%24id%2520)%3Bif%2520(%2520%26%23039%3B%26%23039%3B%2520%3D%3D%3D%2520%24src%2520)%2520%7Bcontinue%3B%7D%24enqueued_dependents%2520%2520%2520%3D%2520array_intersect(%2520%24this-%26gt%3Bget_recursive_dependents(%2520%24id%2520)%2C%2520%24this-%26gt%3Bqueue%2520)%3B%24highest_fetchpriority%2520%3D%2520%24this-%26gt%3Bget_highest_fetchpriority(%2520%24enqueued_dependents%2520)%3Bprintf(%26%23039%3B%26lt%3Blink%2520rel%3D%26quot%3Bmodulepreload%26quot%3B%2520href%3D%26quot%3B%25s%26quot%3B%2520id%3D%26quot%3B%25s%26quot%3B%26%23039%3B%2Cesc_url(%2520%24src%2520)%2Cesc_attr(%2520%24id%2520.%2520%26%23039%3B-js-modulepreload%26%23039%3B%2520))%3Bif%2520(%2520%26%23039%3Bauto%26%23039%3B%2520!%3D%3D%2520%24highest_fetchpriority%2520)%2520%7Bprintf(%2520%26%23039%3B%2520fetchpriority%3D%26quot%3B%25s%26quot%3B%26%23039%3B%2C%2520esc_attr(%2520%24highest_fetchpriority%2520)%2520)%3B%7Dif%2520(%2520%24highest_fetchpriority%2520!%3D%3D%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%5B%26%23039%3Bfetchpriority%26%23039%3B%5D%2520%26amp%3B%26amp%3B%2520%26%23039%3Bauto%26%23039%3B%2520!%3D%3D%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%5B%26%23039%3Bfetchpriority%26%23039%3B%5D%2520)%2520%7Bprintf(%2520%26%23039%3B%2520data-wp-fetchpriority%3D%26quot%3B%25s%26quot%3B%26%23039%3B%2C%2520esc_attr(%2520%24this-%26gt%3Bregistered%5B%2520%24id%2520%5D%5B%26%23039%3Bfetchpriority%26%23039%3B%5D%2520)%2520)%3B%7Decho%2520%26quot%3B%26gt%3B%5Cn%26quot%3B%3B%7D%7D%2F**%2520*%2520Prints%2520the%2520import%2520map%2520using%2520a%2520script%2520tag%2520with%2520a%2520type%3D%26quot%3Bimportmap%26quot%3B%2520attribute.%2520*%2520*%2520%40since%25206.5.0%2520*%2Fpublic%2520function%2520print_import_map()%2520%7B%24import_map%2520%3D%2520%24this-%26gt%3Bget_import_map()%3Bif%2520(%2520!%2520empty(%2520%24import_map%5B%26%23039%3Bimports%26%23039%3B%5D%2520)%2520)%2520%7Bwp_print_inline_script_tag((string)%2520wp_json_encode(%2520%24import_map%2C%2520JSON_HEX_TAG%2520%7C%2520JSON_UNESCAPED_SLASHES%2520)%2Carray(%26%23039%3Btype%26%23039%3B%2520%3D%26gt%3B%2520%26%23039%3Bimportmap%26%23039%3B%2C%26%23039%3Bid%26%23039%3B%2520%2520%2520%3D%26gt%3B%2520%26%23039%3Bwp-importmap%26%23039%3B%2C))%3B%7D%7D%2F**%2520*%2520Returns%2520the%2520import%2520map%2520array.%2520*%2520*%2520%40since%25206.5.0%2520*%2520*%2520%40return%2520array%2520Array%2520with%2520an%2520%2560imports%2560%2520key%2520mapping%2520to%2520an%2520array%2520of%2520script%2520module%2520identifiers%2520and%2520their%2520respective%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520URLs%2C%2520including%2520the%2520version%2520query.%2520*%2Fprivate%2520function%2520get_import_map()%3A%2520array%2520%7B%24imports%2520%3D%2520array()%3Bforeach%2520(%2520array_keys(%2520%24this-%26gt%3Bget_dependencies(%2520%24this-%26gt%3Bqueue%2520)%2520)%2520as%2520%24id%2520)%2520%7B%24src%2520%3D%2520%24this-%26gt%3Bget_src(%2520%24id%2520)%3Bif%2520(%2520%26%23039%3B%26%23039%3B%2520!%3D%3D%2520%24src%2520)%2520%7B%24imports%5B%2520%24id%2520%5D%2520%3D%2520%24src%3B%7D%7Dreturn%2520array(%2520%26%23039%3Bimports%26%23039%3B%2520%3D%26gt%3B%2520%24imports%2520)%3B%7D%2F**%2520*%2520Retrieves%2520the%2520list%2520of%2520script%2520modules%2520marked%2520for%2520enqueue.%2520*%2520*%2520Even%2520though%2520this%2520is%2520a%2520private%2520method%2520and%2520is%2520unused%2520in%2520core%2C%2520there%2520are%2520ecosystem%2520plugins%2520accessing%2520it%2520via%2520the%2520*%2520Reflection%2520API.%2520The%2520ecosystem%2520should%2520rather%2520use%2520%253Ca%2520href%3D"https://developer.wordpress.org/reference/classes/self/get_queue/">self::get_queue().
*
* @since 6.5.0
*
* @return array<string, array> Script modules marked for enqueue, keyed by script module identifier.
*/
private function get_marked_for_enqueue(): array {
return wp_array_slice_assoc(
$this->registered,
$this->queue
);
}
/**
* Retrieves all the dependencies for the given script module identifiers, filtered by import types.
*
* It will consolidate an array containing a set of unique dependencies based
* on the requested import types: 'static', 'dynamic', or both. This method is
* recursive and also retrieves dependencies of the dependencies.
*
* @since 6.5.0
*
* @param string[] $ids The identifiers of the script modules for which to gather dependencies.
* @param string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
* Default is both.
* @return array<string, array> List of dependencies, keyed by script module identifier.
*/
private function get_dependencies( array $ids, array $import_types = array( 'static', 'dynamic' ) ): array {
$all_dependencies = array();
$id_queue = $ids;
while ( ! empty( $id_queue ) ) {
$id = array_shift( $id_queue );
if ( ! isset( $this->registered[ $id ] ) ) {
continue;
}
foreach ( $this->registered[ $id ]['dependencies'] as $dependency ) {
if (
! isset( $all_dependencies[ $dependency['id'] ] ) &&
in_array( $dependency['import'], $import_types, true ) &&
isset( $this->registered[ $dependency['id'] ] )
) {
$all_dependencies[ $dependency['id'] ] = $this->registered[ $dependency['id'] ];
// Add this dependency to the list to get dependencies for.
$id_queue[] = $dependency['id'];
}
}
}
return $all_dependencies;
}
/**
* Gets all dependents of a script module.
*
* This is not recursive.
*
* @since 6.9.0
*
* @see WP_Scripts::get_dependents()
*
* @param string $id The script ID.
* @return string[] Script module IDs.
*/
private function get_dependents( string $id ): array {
// Check if dependents map for the handle in question is present. If so, use it.
if ( isset( $this->dependents_map[ $id ] ) ) {
return $this->dependents_map[ $id ];
}
$dependents = array();
// Iterate over all registered scripts, finding dependents of the script passed to this method.
foreach ( $this->registered as $registered_id => $args ) {
if ( in_array( $id, wp_list_pluck( $args['dependencies'], 'id' ), true ) ) {
$dependents[] = $registered_id;
}
}
// Add the module's dependents to the map to ease future lookups.
$this->dependents_map[ $id ] = $dependents;
return $dependents;
}
/**
* Gets all recursive dependents of a script module.
*
* @since 6.9.0
*
* @see WP_Scripts::get_dependents()
*
* @param string $id The script ID.
* @return string[] Script module IDs.
*/
private function get_recursive_dependents( string $id ): array {
$dependents = array();
$id_queue = array( $id );
$processed = array();
while ( ! empty( $id_queue ) ) {
$current_id = array_shift( $id_queue );
// Skip unregistered or already-processed script modules.
if ( ! isset( $this->registered[ $current_id ] ) || isset( $processed[ $current_id ] ) ) {
continue;
}
// Mark as processed to guard against infinite loops from circular dependencies.
$processed[ $current_id ] = true;
// Find the direct dependents of the current script.
foreach ( $this->get_dependents( $current_id ) as $dependent_id ) {
// Only add the dependent if we haven't found it before.
if ( ! isset( $dependents[ $dependent_id ] ) ) {
$dependents[ $dependent_id ] = true;
// Add dependency to the queue.
$id_queue[] = $dependent_id;
}
}
}
return array_keys( $dependents );
}
/**
* Sorts the given script module identifiers based on their dependencies.
*
* It will return a list of script module identifiers sorted in the order
* they should be printed, so that dependencies are printed before the script
* modules that depend on them.
*
* @since 6.9.0
*
* @param string[] $ids The identifiers of the script modules to sort.
* @param string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
* Default is both.
* @return string[] Sorted list of script module identifiers.
*/
private function get_sorted_dependencies( array $ids, array $import_types = array( 'static', 'dynamic' ) ): array {
$sorted = array();
foreach ( $ids as $id ) {
$this->sort_item_dependencies( $id, $import_types, $sorted );
}
return array_unique( $sorted );
}
/**
* Recursively sorts the dependencies for a single script module identifier.
*
* @since 6.9.0
*
* @param string $id The identifier of the script module to sort.
* @param string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
* @param string[] &$sorted The array of sorted identifiers, passed by reference.
* @return bool True on success, false on failure (e.g., missing dependency).
*/
private function sort_item_dependencies( string $id, array $import_types, array &$sorted ): bool {
// If already processed, don't do it again.
if ( in_array( $id, $sorted, true ) ) {
return true;
}
// If the item doesn't exist, fail.
if ( ! isset( $this->registered[ $id ] ) ) {
return false;
}
$dependency_ids = array();
foreach ( $this->registered[ $id ]['dependencies'] as $dependency ) {
if ( in_array( $dependency['import'], $import_types, true ) ) {
$dependency_ids[] = $dependency['id'];
}
}
// If the item requires dependencies that do not exist, fail.
$missing_dependencies = array_diff( $dependency_ids, array_keys( $this->registered ) );
if ( count( $missing_dependencies ) > 0 ) {
if ( ! in_array( $id, $this->modules_with_missing_dependencies, true ) ) {
_doing_it_wrong(
get_class( $this ) . '::register',
sprintf(
/* translators: 1: Script module ID, 2: List of missing dependency IDs. */
__( 'The script module with the ID "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
$id,
implode( wp_get_list_item_separator(), $missing_dependencies )
),
'6.9.1'
);
$this->modules_with_missing_dependencies[] = $id;
}
return false;
}
// Recursively process dependencies.
foreach ( $dependency_ids as $dependency_id ) {
if ( ! $this->sort_item_dependencies( $dependency_id, $import_types, $sorted ) ) {
// A dependency failed to resolve, so this branch fails.
return false;
}
}
// All dependencies are sorted, so we can now add the current item.
$sorted[] = $id;
return true;
}
/**
* Gets the versioned URL for a script module src.
*
* If $version is set to false, the version number is the currently installed
* WordPress version. If $version is set to null, no version is added.
* Otherwise, the string passed in $version is used.
*
* @since 6.5.0
*
* @param string $id The script module identifier.
* @return string The script module src with a version if relevant.
*/
private function get_src( string $id ): string {
if ( ! isset( $this->registered[ $id ] ) ) {
return '';
}
$script_module = $this->registered[ $id ];
$src="/?originalUrl=https%3A%2F%2Fdeveloper.wordpress.org%2F%24script_module%5B%26%23039%3Bsrc%26%23039%3B%5D%3Bif%2520(%2520%26%23039%3B%26%23039%3B%2520!%3D%3D%2520%24src%2520)%2520%7Bif%2520(%2520false%2520%3D%3D%3D%2520%24script_module%5B%26%23039%3Bversion%26%23039%3B%5D%2520)%2520%7B%24src%2520%3D%2520add_query_arg(%2520%26%23039%3Bver%26%23039%3B%2C%2520get_bloginfo(%2520%26%23039%3Bversion%26%23039%3B%2520)%2C%2520%24src%2520)%3B%7D%2520elseif%2520(%2520null%2520!%3D%3D%2520%24script_module%5B%26%23039%3Bversion%26%23039%3B%5D%2520)%2520%7B%24src%2520%3D%2520add_query_arg(%2520%26%23039%3Bver%26%23039%3B%2C%2520%24script_module%5B%26%23039%3Bversion%26%23039%3B%5D%2C%2520%24src%2520)%3B%7D%7D%2F**%2520*%2520Filters%2520the%2520script%2520module%2520source.%2520*%2520*%2520%40since%25206.5.0%2520*%2520*%2520%40param%2520string%2520%24src%2520Module%2520source%2520URL.%2520*%2520%40param%2520string%2520%24id%2520%2520Module%2520identifier.%2520*%2F%24src%2520%3D%2520apply_filters(%2520%26%23039%3Bscript_module_loader_src%26%23039%3B%2C%2520%24src%2C%2520%24id%2520)%3Bif%2520(%2520!%2520is_string(%2520%24src%2520)%2520)%2520%7B%24src%2520%3D%2520%26%23039%3B%26%23039%3B%3B%7Dreturn%2520%24src%3B%7D%2F**%2520*%2520Print%2520data%2520associated%2520with%2520Script%2520Modules.%2520*%2520*%2520The%2520data%2520will%2520be%2520embedded%2520in%2520the%2520page%2520HTML%2520and%2520can%2520be%2520read%2520by%2520Script%2520Modules%2520on%2520page%2520load.%2520*%2520*%2520%40since%25206.7.0%2520*%2520*%2520Data%2520can%2520be%2520associated%2520with%2520a%2520Script%2520Module%2520via%2520the%2520*%2520%26quot%3Bscript_module_data_%7B%24module_id%26quot%3B%7D%2520filter.%2520*%2520*%2520The%2520data%2520for%2520a%2520Script%2520Module%2520will%2520be%2520serialized%2520as%2520JSON%2520in%2520a%2520script%2520tag%2520with%2520an%2520ID%2520of%2520the%2520*%2520form%2520%2560wp-script-module-data-%7B%24module_id%7D%2560.%2520*%2Fpublic%2520function%2520print_script_module_data()%3A%2520void%2520%7B%24modules%2520%3D%2520array()%3Bforeach%2520(%2520array_unique(%2520%24this-%26gt%3Bqueue%2520)%2520as%2520%24id%2520)%2520%7Bif%2520(%2520%26%23039%3B%40wordpress%2Fa11y%26%23039%3B%2520%3D%3D%3D%2520%24id%2520)%2520%7B%24this-%26gt%3Ba11y_available%2520%3D%2520true%3B%7D%24modules%5B%2520%24id%2520%5D%2520%3D%2520true%3B%7Dforeach%2520(%2520array_keys(%2520%24this-%26gt%3Bget_import_map()%5B%26%23039%3Bimports%26%23039%3B%5D%2520)%2520as%2520%24id%2520)%2520%7Bif%2520(%2520%26%23039%3B%40wordpress%2Fa11y%26%23039%3B%2520%3D%3D%3D%2520%24id%2520)%2520%7B%24this-%26gt%3Ba11y_available%2520%3D%2520true%3B%7D%24modules%5B%2520%24id%2520%5D%2520%3D%2520true%3B%7Dforeach%2520(%2520array_keys(%2520%24modules%2520)%2520as%2520%24module_id%2520)%2520%7B%2F**%2520*%2520Filters%2520data%2520associated%2520with%2520a%2520given%2520Script%2520Module.%2520*%2520*%2520Script%2520Modules%2520may%2520require%2520data%2520that%2520is%2520required%2520for%2520initialization%2520or%2520is%2520essential%2520*%2520to%2520have%2520immediately%2520available%2520on%2520page%2520load.%2520These%2520are%2520suitable%2520use%2520cases%2520for%2520*%2520this%2520data.%2520*%2520*%2520The%2520dynamic%2520portion%2520of%2520the%2520hook%2520name%2C%2520%2560%24module_id%2560%2C%2520refers%2520to%2520the%2520Script%2520Module%2520ID%2520*%2520that%2520the%2520data%2520is%2520associated%2520with.%2520*%2520*%2520This%2520is%2520best%2520suited%2520to%2520pass%2520essential%2520data%2520that%2520must%2520be%2520available%2520to%2520the%2520module%2520for%2520*%2520initialization%2520or%2520immediately%2520on%2520page%2520load.%2520It%2520does%2520not%2520replace%2520the%2520REST%2520API%2520or%2520*%2520fetching%2520data%2520from%2520the%2520client.%2520*%2520*%2520Example%3A%2520*%2520*%2520%2520%2520%2520%2520add_filter(%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520%26%23039%3Bscript_module_data_MyScriptModuleID%26%23039%3B%2C%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520function%2520(%2520array%2520%24data%2520)%3A%2520array%2520%7B%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%24data%5B%26%23039%3BdataForClient%26%23039%3B%5D%2520%3D%2520%26%23039%3Bok%26%23039%3B%3B%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520%24data%3B%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2520*%2520%2520%2520%2520%2520)%3B%2520*%2520*%2520If%2520the%2520filter%2520returns%2520no%2520data%2520(an%2520empty%2520array)%2C%2520nothing%2520will%2520be%2520embedded%2520in%2520the%2520page.%2520*%2520*%2520The%2520data%2520for%2520a%2520given%2520Script%2520Module%2C%2520if%2520provided%2C%2520will%2520be%2520JSON%2520serialized%2520in%2520a%2520script%2520*%2520tag%2520with%2520an%2520ID%2520of%2520the%2520form%2520%2560wp-script-module-data-%7B%24module_id%7D%2560.%2520*%2520*%2520The%2520data%2520can%2520be%2520read%2520on%2520the%2520client%2520with%2520a%2520pattern%2520like%2520this%3A%2520*%2520*%2520Example%3A%2520*%2520*%2520%2520%2520%2520%2520const%2520dataContainer%2520%3D%2520document.getElementById(%2520%26%23039%3Bwp-script-module-data-MyScriptModuleID%26%23039%3B%2520)%3B%2520*%2520%2520%2520%2520%2520let%2520data%2520%3D%2520%7B%7D%3B%2520*%2520%2520%2520%2520%2520if%2520(%2520dataContainer%2520)%2520%7B%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520try%2520%7B%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520data%2520%3D%2520JSON.parse(%2520dataContainer.textContent%2520)%3B%2520*%2520%2520%2520%2520%2520%2520%2520%2520%2520%7D%2520catch%2520%7B%7D%2520*%2520%2520%2520%2520%2520%7D%2520*%2520%2520%2520%2520%2520%2F%2F%2520data.dataForClient%2520%3D%3D%3D%2520%26%23039%3Bok%26%23039%3B%3B%2520*%2520%2520%2520%2520%2520initMyScriptModuleWithData(%2520data%2520)%3B%2520*%2520*%2520%40since%25206.7.0%2520*%2520*%2520%40param%2520array%2520%24data%2520The%2520data%2520associated%2520with%2520the%2520Script%2520Module.%2520*%2F%24data%2520%3D%2520apply_filters(%2520%26quot%3Bscript_module_data_%7B%24module_id%7D%26quot%3B%2C%2520array()%2520)%3Bif%2520(%2520is_array(%2520%24data%2520)%2520%26amp%3B%26amp%3B%2520array()%2520!%3D%3D%2520%24data%2520)%2520%7B%2F*%2520*%2520This%2520data%2520will%2520be%2520printed%2520as%2520JSON%2520inside%2520a%2520script%2520tag%2520like%2520this%3A%2520*%2520%2520%2520%26lt%3Bscript%2520type%3D%26quot%3Bapplication%2Fjson%26quot%3B%26gt%3B%26lt%3B%2Fscript%26gt%3B%2520*%2520*%2520A%2520script%2520tag%2520must%2520be%2520closed%2520by%2520a%2520sequence%2520beginning%2520with%2520%2560%26lt%3B%2F%2560.%2520It%26%23039%3Bs%2520impossible%2520to%2520*%2520close%2520a%2520script%2520tag%2520without%2520using%2520%2560%26lt%3B%2560.%2520We%2520ensure%2520that%2520%2560%26lt%3B%2560%2520is%2520escaped%2520and%2520%2560%2F%2560%2520can%2520*%2520remain%2520unescaped%2C%2520so%2520%2560%26lt%3B%2Fscript%26gt%3B%2560%2520will%2520be%2520printed%2520as%2520%2560%5Cu003C%2Fscript%5Cu00E3%2560.%2520*%2520*%2520%2520%2520-%2520JSON_HEX_TAG%3A%2520All%2520%26lt%3B%2520and%2520%26gt%3B%2520are%2520converted%2520to%2520%5Cu003C%2520and%2520%5Cu003E.%2520*%2520%2520%2520-%2520JSON_UNESCAPED_SLASHES%3A%2520Don%26%23039%3Bt%2520escape%2520%2F.%2520*%2520*%2520If%2520the%2520page%2520will%2520use%2520UTF-8%2520encoding%2C%2520it%26%23039%3Bs%2520safe%2520to%2520print%2520unescaped%2520unicode%3A%2520*%2520*%2520%2520%2520-%2520JSON_UNESCAPED_UNICODE%3A%2520Encode%2520multibyte%2520Unicode%2520characters%2520literally%2520(instead%2520of%2520as%2520%2560%5CuXXXX%2560).%2520*%2520%2520%2520-%2520JSON_UNESCAPED_LINE_TERMINATORS%3A%2520The%2520line%2520terminators%2520are%2520kept%2520unescaped%2520when%2520*%2520%2520%2520%2520%2520JSON_UNESCAPED_UNICODE%2520is%2520supplied.%2520It%2520uses%2520the%2520same%2520behaviour%2520as%2520it%2520was%2520*%2520%2520%2520%2520%2520before%2520PHP%25207.1%2520without%2520this%2520constant.%2520Available%2520as%2520of%2520PHP%25207.1.0.%2520*%2520*%2520The%2520JSON%2520specification%2520requires%2520encoding%2520in%2520UTF-8%2C%2520so%2520if%2520the%2520generated%2520HTML%2520page%2520*%2520is%2520not%2520encoded%2520in%2520UTF-8%2520then%2520it%26%23039%3Bs%2520not%2520safe%2520to%2520include%2520those%2520literals.%2520They%2520must%2520*%2520be%2520escaped%2520to%2520avoid%2520encoding%2520issues.%2520*%2520*%2520%40see%2520https%3A%2F%2Fwww.rfc-editor.org%2Frfc%2Frfc8259.html%2520for%2520details%2520on%2520encoding%2520requirements.%2520*%2520%40see%2520https%3A%2F%2Fwww.php.net%2Fmanual%2Fen%2Fjson.constants.php%2520for%2520details%2520on%2520these%2520constants.%2520*%2520%40see%2520https%3A%2F%2Fhtml.spec.whatwg.org%2F%23script-data-state%2520for%2520details%2520on%2520script%2520tag%2520parsing.%2520*%2F%24json_encode_flags%2520%3D%2520JSON_HEX_TAG%2520%7C%2520JSON_UNESCAPED_SLASHES%2520%7C%2520JSON_UNESCAPED_UNICODE%2520%7C%2520JSON_UNESCAPED_LINE_TERMINATORS%3Bif%2520(%2520!%2520is_utf8_charset()%2520)%2520%7B%24json_encode_flags%2520%3D%2520JSON_HEX_TAG%2520%7C%2520JSON_UNESCAPED_SLASHES%3B%7Dwp_print_inline_script_tag((string)%2520wp_json_encode(%24data%2C%24json_encode_flags)%2Carray(%26%23039%3Btype%26%23039%3B%2520%3D%26gt%3B%2520%26%23039%3Bapplication%2Fjson%26%23039%3B%2C%26%23039%3Bid%26%23039%3B%2520%2520%2520%3D%26gt%3B%2520%26quot%3Bwp-script-module-data-%7B%24module_id%7D%26quot%3B%2C))%3B%7D%7D%7D%2F**%2520*%2520%40access%2520private%2520This%2520is%2520only%2520intended%2520to%2520be%2520called%2520by%2520the%2520registered%2520actions.%2520*%2520*%2520%40since%25206.7.0%2520*%2Fpublic%2520function%2520print_a11y_script_module_html()%2520%7Bif%2520(%2520!%2520%24this-%26gt%3Ba11y_available%2520)%2520%7Breturn%3B%7Decho%2520%26%23039%3B%26lt%3Bdiv%2520style%3D%26quot%3Bposition%3Aabsolute%3Bmargin%3A-1px%3Bpadding%3A0%3Bheight%3A1px%3Bwidth%3A1px%3Boverflow%3Ahidden%3Bclip-path%3Ainset(50%25)%3Bborder%3A0%3Bword-wrap%3Anormal%2520!important%3B%26quot%3B%26gt%3B%26%23039%3B.%2520%26%23039%3B%26lt%3Bp%2520id%3D%26quot%3Ba11y-speak-intro-text%26quot%3B%2520class%3D%26quot%3Ba11y-speak-intro-text%26quot%3B%2520hidden%26gt%3B%26%23039%3B%2520.%2520esc_html__(%2520%26%23039%3BNotifications%26%23039%3B%2520)%2520.%2520%26%23039%3B%26lt%3B%2Fp%26gt%3B%26%23039%3B.%2520%26%23039%3B%26lt%3Bdiv%2520id%3D%26quot%3Ba11y-speak-assertive%26quot%3B%2520class%3D%26quot%3Ba11y-speak-region%26quot%3B%2520aria-live%3D%26quot%3Bassertive%26quot%3B%2520aria-relevant%3D%26quot%3Badditions%2520text%26quot%3B%2520aria-atomic%3D%26quot%3Btrue%26quot%3B%26gt%3B%26lt%3B%2Fdiv%26gt%3B%26%23039%3B.%2520%26%23039%3B%26lt%3Bdiv%2520id%3D%26quot%3Ba11y-speak-polite%26quot%3B%2520class%3D%26quot%3Ba11y-speak-region%26quot%3B%2520aria-live%3D%26quot%3Bpolite%26quot%3B%2520aria-relevant%3D%26quot%3Badditions%2520text%26quot%3B%2520aria-atomic%3D%26quot%3Btrue%26quot%3B%26gt%3B%26lt%3B%2Fdiv%26gt%3B%26%23039%3B.%2520%26%23039%3B%26lt%3B%2Fdiv%26gt%3B%26%23039%3B%3B%7D%7D%253C%2Fcode">
View all references View on Trac View on GitHub
User Contributed Notes
You must log in before being able to contribute a note or feedback.