
网络开发中的Git:了解一个项目的典型工作流程
wp_localize_script ( $handle, $object_name, $l10n )
Localize a script.
Works only if the script has already been registered.
Accepts an associative array $l10n and creates a JavaScript object:
“$object_name” = {
key: value,
key: value,
…
}
function wp_localize_script( $handle, $object_name, $l10n ) { global $wp_scripts; if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); return false; } return $wp_scripts->localize( $handle, $object_name, $l10n ); }