Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Frontend_Scripts::localize_script( string $handle )
Localize a WC script once.
Description Description
Parameters Parameters
- $handle
-
(Required) Script handle the data will be attached to.
Source Source
File: includes/class-wc-frontend-scripts.php
private static function localize_script( $handle ) { if ( ! in_array( $handle, self::$wp_localize_scripts, true ) && wp_script_is( $handle ) ) { $data = self::get_script_data( $handle ); if ( ! $data ) { return; } $name = str_replace( '-', '_', $handle ) . '_params'; self::$wp_localize_scripts[] = $handle; wp_localize_script( $handle, $name, apply_filters( $name, $data ) ); } }
Changelog Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |