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 { 'button.url' => static function ( ContainerInterface $container ): string {
return plugins_url( return plugins_url(
'/modules/ppcp-button/', '/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 { '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() ) { if ( in_array( $this->context(), array( 'pay-now', 'checkout' ), true ) && $this->can_render_dcc() ) {
wp_enqueue_style( wp_enqueue_style(
'ppcp-hosted-fields', 'ppcp-hosted-fields',
$this->module_url . '/assets/css/hosted-fields.css', untrailingslashit( $this->module_url ) . '/assets/css/hosted-fields.css',
array(), array(),
1 1
); );
@ -415,7 +415,7 @@ class SmartButton implements SmartButtonInterface {
if ( $load_script ) { if ( $load_script ) {
wp_enqueue_script( wp_enqueue_script(
'ppcp-smart-button', 'ppcp-smart-button',
$this->module_url . '/assets/js/button.js', untrailingslashit( $this->module_url ) . '/assets/js/button.js',
array( 'jquery' ), array( 'jquery' ),
'1.3.2', '1.3.2',
true true

View file

@ -139,7 +139,7 @@ return array(
'onboarding.url' => static function ( ContainerInterface $container ): string { 'onboarding.url' => static function ( ContainerInterface $container ): string {
return plugins_url( return plugins_url(
'/modules/ppcp-onboarding/', '/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 { public function register(): bool {
$url = $this->module_url . '/assets/css/onboarding.css'; $url = untrailingslashit( $this->module_url ) . '/assets/css/onboarding.css';
wp_register_style( wp_register_style(
'ppcp-onboarding', 'ppcp-onboarding',
$url, $url,
array(), array(),
1 1
); );
$url = $this->module_url . '/assets/js/settings.js'; $url = untrailingslashit( $this->module_url ) . '/assets/js/settings.js';
wp_register_script( wp_register_script(
'ppcp-settings', 'ppcp-settings',
$url, $url,
@ -79,7 +79,7 @@ class OnboardingAssets {
true true
); );
$url = $this->module_url . '/assets/js/onboarding.js'; $url = untrailingslashit( $this->module_url ) . '/assets/js/onboarding.js';
wp_register_script( wp_register_script(
'ppcp-onboarding', 'ppcp-onboarding',
$url, $url,

View file

@ -17,7 +17,7 @@ return array(
'vaulting.module-url' => static function ( ContainerInterface $container ): string { 'vaulting.module-url' => static function ( ContainerInterface $container ): string {
return plugins_url( return plugins_url(
'/modules/ppcp-vaulting/', '/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 { 'vaulting.assets.myaccount-payments' => function( ContainerInterface $container ) : MyAccountPaymentsAssets {

View file

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

View file

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

View file

@ -197,7 +197,7 @@ return array(
'webhook.module-url' => static function ( ContainerInterface $container ): string { 'webhook.module-url' => static function ( ContainerInterface $container ): string {
return plugins_url( return plugins_url(
'/modules/ppcp-webhooks/', '/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 { public function register(): void {
wp_register_style( wp_register_style(
'ppcp-webhooks-status-page-style', 'ppcp-webhooks-status-page-style',
$this->module_url . '/assets/css/status-page.css', untrailingslashit( $this->module_url ) . '/assets/css/status-page.css',
array(), array(),
'1' '1'
); );
wp_register_script( wp_register_script(
'ppcp-webhooks-status-page', 'ppcp-webhooks-status-page',
$this->module_url . '/assets/js/status-page.js', untrailingslashit( $this->module_url ) . '/assets/js/status-page.js',
array(), array(),
'1', '1',
true true