-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
assets: Provide the
wp-jp-i18n-state
script
This script is the one expected by the default configuration of the new `@automattic/i18n-loader-webpack-plugin`. Note the `domainMap` is currently empty. Code to fill that in will come later, as part of #21690, once we figure out the exact form of it.
- Loading branch information
Showing
5 changed files
with
238 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* Action Hooks for Jetpack Assets module. | ||
* | ||
* @package automattic/jetpack-assets | ||
*/ | ||
|
||
// If WordPress's plugin API is available already, use it. If not, | ||
// drop data into `$wp_filter` for `WP_Hook::build_preinitialized_hooks()`. | ||
if ( function_exists( 'add_action' ) ) { | ||
add_action( 'wp_default_scripts', array( Automattic\Jetpack\Assets::class, 'wp_default_scripts_hook' ) ); | ||
} else { | ||
global $wp_filter; | ||
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited | ||
$wp_filter['wp_default_scripts'][10][] = array( | ||
'accepted_args' => 1, | ||
'function' => array( Automattic\Jetpack\Assets::class, 'wp_default_scripts_hook' ), | ||
); | ||
} |
4 changes: 4 additions & 0 deletions
4
projects/packages/assets/changelog/add-use-i18n-loader-webpack-plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Generate `wp-jp-i18n-state` script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters