From e850028a1c470f8209a0363f19f31b3485752192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lys=C3=BD?= Date: Thu, 31 Oct 2024 20:43:41 +0100 Subject: [PATCH] Migrate email editor cdn-asset-url class to WP Coding Standard [MAILPOET-6240] --- .../Library/class-default-content-full.php | 4 +- .../Library/class-default-content.php | 2 +- .../src/Utils/class-cdn-asset-url.php | 43 +++++++++++++++---- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/packages/php/email-editor/src/Engine/Patterns/Library/class-default-content-full.php b/packages/php/email-editor/src/Engine/Patterns/Library/class-default-content-full.php index b6fe42ad1b..f35f03b372 100644 --- a/packages/php/email-editor/src/Engine/Patterns/Library/class-default-content-full.php +++ b/packages/php/email-editor/src/Engine/Patterns/Library/class-default-content-full.php @@ -40,13 +40,13 @@ class Default_Content_Full extends Abstract_Pattern {
-
Your Logo
+
Your Logo

' . __( 'One column layout', 'mailpoet' ) . '

-
Banner Image
+
Banner Image

' . esc_html__( 'A one-column layout is great for simplified and concise content, like announcements or newsletters with brief updates. Drag blocks to add content and customize your styles from the styles panel on the top right.', 'mailpoet' ) . '

diff --git a/packages/php/email-editor/src/Engine/Patterns/Library/class-default-content.php b/packages/php/email-editor/src/Engine/Patterns/Library/class-default-content.php index 688d0c7f7c..5b7f80f5c5 100644 --- a/packages/php/email-editor/src/Engine/Patterns/Library/class-default-content.php +++ b/packages/php/email-editor/src/Engine/Patterns/Library/class-default-content.php @@ -44,7 +44,7 @@ class Default_Content extends Abstract_Pattern {

' . __( 'One column layout', 'mailpoet' ) . '

-
Banner Image
+
Banner Image

' . esc_html__( 'A one-column layout is great for simplified and concise content, like announcements or newsletters with brief updates. Drag blocks to add content and customize your styles from the styles panel on the top right.', 'mailpoet' ) . '

diff --git a/packages/php/email-editor/src/Utils/class-cdn-asset-url.php b/packages/php/email-editor/src/Utils/class-cdn-asset-url.php index 03c934ae19..e7c0aa9fee 100644 --- a/packages/php/email-editor/src/Utils/class-cdn-asset-url.php +++ b/packages/php/email-editor/src/Utils/class-cdn-asset-url.php @@ -1,20 +1,47 @@ -baseUrl = $baseUrl; + $this->base_url = $base_url; } - public function generateCdnUrl( $path ) { - $useCdn = defined( 'MAILPOET_USE_CDN' ) ? MAILPOET_USE_CDN : true; - return ( $useCdn ? self::CDN_URL : $this->baseUrl . '/plugin_repository/' ) . "assets/$path"; + /** + * Generate CDN URL for assets. + * + * @param string $path - Path for assets. + * @return string + */ + public function generate_cdn_url( $path ) { + $use_cdn = defined( 'MAILPOET_USE_CDN' ) ? MAILPOET_USE_CDN : true; + return ( $use_cdn ? self::CDN_URL : $this->base_url . '/plugin_repository/' ) . "assets/$path"; } }