Unify OSA script handles

Stick to `wc-` convention instead of `woocommerce-`.
Do not add a superflous `-js` suffix`
This commit is contained in:
Tomek Wytrębowicz 2023-11-21 20:27:35 +01:00 committed by Justin Palmer
parent 5b16a8abdb
commit e91d0325ae
No known key found for this signature in database
GPG Key ID: ACAB7C35AA2577AF
2 changed files with 6 additions and 6 deletions

View File

@ -123,16 +123,16 @@ class SourceAttributionBlocksController implements RegisterHooksInterface {
// $this->asset_api->register_script(
// 'wc-blocks-order-source-attribution',
// 'build/wc-blocks-order-source-attribution.js',
// [ 'woocommerce-order-source-attribution-js' ]
// [ 'wc-order-source-attribution' ]
// );
wp_register_script(
'wc-blocks-order-source-attribution',
'wc-order-source-attribution-blocks',
plugins_url(
"assets/js/frontend/order-source-attribution-blocks{$this->get_script_suffix()}.js",
WC_PLUGIN_FILE
),
array( 'woocommerce-order-source-attribution-js', 'wp-data', 'wc-blocks-checkout' ),
array( 'wc-order-source-attribution', 'wp-data', 'wc-blocks-checkout' ),
Constants::get_constant( 'WC_VERSION' ),
true
);
@ -145,7 +145,7 @@ class SourceAttributionBlocksController implements RegisterHooksInterface {
* @return void
*/
private function enqueue_scripts() {
wp_enqueue_script( 'wc-blocks-order-source-attribution' );
wp_enqueue_script( 'wc-order-source-attribution-blocks' );
}
/**

View File

@ -187,7 +187,7 @@ class SourceAttributionController implements RegisterHooksInterface {
);
wp_enqueue_script(
'woocommerce-order-source-attribution-js',
'wc-order-source-attribution',
plugins_url( "assets/js/frontend/order-source-attribution{$this->get_script_suffix()}.js", WC_PLUGIN_FILE ),
array( 'jquery', 'sourcebuster-js' ),
Constants::get_constant( 'WC_VERSION' ),
@ -232,7 +232,7 @@ class SourceAttributionController implements RegisterHooksInterface {
),
);
wp_localize_script( 'woocommerce-order-source-attribution-js', 'wc_order_source_attribution', $namespace );
wp_localize_script( 'wc-order-source-attribution', 'wc_order_source_attribution', $namespace );
}
/**