Merge pull request #439 from woocommerce/pcp-499-fix-asset-paths

Fix asset paths
This commit is contained in:
Emili Castells 2022-01-20 09:54:03 +01:00 committed by GitHub
commit bbe45c4c8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 14 additions and 14 deletions

View file

@ -90,7 +90,7 @@ return array(
'button.url' => static function ( ContainerInterface $container ): string {
return plugins_url(
'/modules/ppcp-button/',
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
);
},
'button.request-data' => static function ( ContainerInterface $container ): RequestData {

View file

@ -407,7 +407,7 @@ class SmartButton implements SmartButtonInterface {
if ( in_array( $this->context(), array( 'pay-now', 'checkout' ), true ) && $this->can_render_dcc() ) {
wp_enqueue_style(
'ppcp-hosted-fields',
$this->module_url . '/assets/css/hosted-fields.css',
untrailingslashit( $this->module_url ) . '/assets/css/hosted-fields.css',
array(),
1
);
@ -415,7 +415,7 @@ class SmartButton implements SmartButtonInterface {
if ( $load_script ) {
wp_enqueue_script(
'ppcp-smart-button',
$this->module_url . '/assets/js/button.js',
untrailingslashit( $this->module_url ) . '/assets/js/button.js',
array( 'jquery' ),
'1.3.2',
true

View file

@ -139,7 +139,7 @@ return array(
'onboarding.url' => static function ( ContainerInterface $container ): string {
return plugins_url(
'/modules/ppcp-onboarding/',
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
);
},

View file

@ -63,14 +63,14 @@ class OnboardingAssets {
*/
public function register(): bool {
$url = $this->module_url . '/assets/css/onboarding.css';
$url = untrailingslashit( $this->module_url ) . '/assets/css/onboarding.css';
wp_register_style(
'ppcp-onboarding',
$url,
array(),
1
);
$url = $this->module_url . '/assets/js/settings.js';
$url = untrailingslashit( $this->module_url ) . '/assets/js/settings.js';
wp_register_script(
'ppcp-settings',
$url,
@ -79,7 +79,7 @@ class OnboardingAssets {
true
);
$url = $this->module_url . '/assets/js/onboarding.js';
$url = untrailingslashit( $this->module_url ) . '/assets/js/onboarding.js';
wp_register_script(
'ppcp-onboarding',
$url,

View file

@ -17,7 +17,7 @@ return array(
'vaulting.module-url' => static function ( ContainerInterface $container ): string {
return plugins_url(
'/modules/ppcp-vaulting/',
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
);
},
'vaulting.assets.myaccount-payments' => function( ContainerInterface $container ) : MyAccountPaymentsAssets {

View file

@ -42,7 +42,7 @@ class MyAccountPaymentsAssets {
public function enqueue(): void {
wp_enqueue_script(
'ppcp-vaulting-myaccount-payments',
$this->module_url . '/assets/js/myaccount-payments.js',
untrailingslashit( $this->module_url ) . '/assets/js/myaccount-payments.js',
array( 'jquery' ),
'1',
true

View file

@ -1988,7 +1988,7 @@ return array(
'wcgateway.url' => static function ( ContainerInterface $container ): string {
return plugins_url(
$container->get( 'wcgateway.relative-path' ),
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
);
},
'wcgateway.relative-path' => static function( ContainerInterface $container ): string {
@ -1996,7 +1996,7 @@ return array(
},
'wcgateway.absolute-path' => static function( ContainerInterface $container ): string {
return plugin_dir_path(
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
) .
$container->get( 'wcgateway.relative-path' );
},

View file

@ -197,7 +197,7 @@ return array(
'webhook.module-url' => static function ( ContainerInterface $container ): string {
return plugins_url(
'/modules/ppcp-webhooks/',
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
);
},
);

View file

@ -45,14 +45,14 @@ class WebhooksStatusPageAssets {
public function register(): void {
wp_register_style(
'ppcp-webhooks-status-page-style',
$this->module_url . '/assets/css/status-page.css',
untrailingslashit( $this->module_url ) . '/assets/css/status-page.css',
array(),
'1'
);
wp_register_script(
'ppcp-webhooks-status-page',
$this->module_url . '/assets/js/status-page.js',
untrailingslashit( $this->module_url ) . '/assets/js/status-page.js',
array(),
'1',
true