From e23b6a68f39d30f33ebd09e0226b393c504e8a66 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Wed, 26 Jun 2024 11:28:28 -0400 Subject: [PATCH 1/4] add second address line to newsletter footer --- blocks/footer/edit.tsx | 7 ++++++- blocks/footer/render.php | 8 +++++++- blocks/footer/style.scss | 12 +++++++++++- src/class-rest-api-endpoints.php | 1 + src/class-settings.php | 8 +++++++- 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/blocks/footer/edit.tsx b/blocks/footer/edit.tsx index bd27a835..6257d89c 100644 --- a/blocks/footer/edit.tsx +++ b/blocks/footer/edit.tsx @@ -25,6 +25,7 @@ interface FooterSettings { youtube_url: string, image: number, address: string, + address_2: string, } /** @@ -45,6 +46,7 @@ export default function Edit() { const youtubeUrl = footerSettings?.youtube_url ?? ''; const imageId = footerSettings?.image ?? 0; const address = footerSettings?.address ?? ''; + const address2 = footerSettings?.address_2 ?? ''; useEffect(() => { setIsLoading(true); @@ -121,7 +123,10 @@ export default function Edit() { ? (
{__('Our mailing address is:', 'wp-newsletter-builder')} - {address} +
+ {address} + {address2 ? ({address2}) : null} +
) : null} diff --git a/blocks/footer/render.php b/blocks/footer/render.php index 7ed53546..b7633693 100644 --- a/blocks/footer/render.php +++ b/blocks/footer/render.php @@ -17,6 +17,7 @@ $nb_youtube_url = $nb_footer_settings['youtube_url'] ?? ''; $nb_image_id = $nb_footer_settings['image'] ?? 0; $nb_address = $nb_footer_settings['address'] ?? ''; +$nb_address_2 = $nb_footer_settings['address_2'] ?? ''; $nb_has_social_links = ! empty( $nb_facebook_url ) || ! empty( $nb_twitter_url ) || ! empty( $nb_instagram_url ) || ! empty( $nb_youtube_url ); $plugin_url = plugins_url( 'wp-newsletter-builder' ); @@ -84,7 +85,12 @@ diff --git a/blocks/footer/style.scss b/blocks/footer/style.scss index 71e73d37..55d756db 100644 --- a/blocks/footer/style.scss +++ b/blocks/footer/style.scss @@ -66,11 +66,21 @@ .wp-block-wp-newsletter-builder-footer__address { margin-top: 20px; - span { + > span { display: block; font-weight: 700; text-align: center; } + + address { + display: block; + font-style: normal; + text-align: center; + + > span { + display: block; + }; + } } .wp-block-wp-newsletter-builder-footer__links { diff --git a/src/class-rest-api-endpoints.php b/src/class-rest-api-endpoints.php index 5f89ce29..abeafd36 100644 --- a/src/class-rest-api-endpoints.php +++ b/src/class-rest-api-endpoints.php @@ -144,6 +144,7 @@ public function get_email_types(): WP_Error|array { * youtube_url?: string, * image?: int, * address?: string, + * address_2?: string, * } */ public function get_footer_settings(): WP_Error|false|array { diff --git a/src/class-settings.php b/src/class-settings.php index b4f439e0..73708e20 100644 --- a/src/class-settings.php +++ b/src/class-settings.php @@ -92,7 +92,12 @@ public function register_fields(): void { ), 'address' => new \Fieldmanager_TextField( [ - 'label' => __( 'Company Address', 'wp-newsletter-builder' ), + 'label' => __( 'Company Address Line 1', 'wp-newsletter-builder' ), + ] + ), + 'address_2' => new \Fieldmanager_TextField( + [ + 'label' => __( 'Company Address Line 2', 'wp-newsletter-builder' ), ] ), ], @@ -160,6 +165,7 @@ public function get_lists(): mixed { * youtube_url?: string, * image?: int, * address?: string, + * address_2?: string, * }|false The footer settings. */ public function get_footer_settings(): array|false { From 31ba1b65d26c0565bae7075277fa521c91fbfc7e Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Wed, 26 Jun 2024 11:29:03 -0400 Subject: [PATCH 2/4] styling clean up --- blocks/header/style.scss | 4 ++++ scss/core-blocks/latest-posts.scss | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/blocks/header/style.scss b/blocks/header/style.scss index f9ecd533..551a1d2a 100644 --- a/blocks/header/style.scss +++ b/blocks/header/style.scss @@ -21,4 +21,8 @@ display: flex; justify-content: center; } + + img { + margin: 0 auto; + } } diff --git a/scss/core-blocks/latest-posts.scss b/scss/core-blocks/latest-posts.scss index 57bab25a..3d635628 100644 --- a/scss/core-blocks/latest-posts.scss +++ b/scss/core-blocks/latest-posts.scss @@ -5,6 +5,14 @@ padding: 0; width: 100%; + a { + color: currentColor; + display: block; + font-weight: bold; + margin-bottom: 8px; + text-decoration: none; + } + li { border-bottom: 1px solid #ccc; box-sizing: border-box; @@ -82,7 +90,7 @@ } img { - max-width: none; + max-width: 100%; width: 100%; } } From db87f4a1a48dac5bcb4a7fa5f8e7b15482888f20 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Wed, 26 Jun 2024 11:31:59 -0400 Subject: [PATCH 3/4] version bump --- README.md | 2 +- plugin.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b8b5c87..60bb24dc 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Contributors: alleyinteractive Tags: alleyinteractive, wp-newsletter-builder -Stable tag: 0.3.30 +Stable tag: 0.3.31 Requires at least: 6.2 diff --git a/plugin.php b/plugin.php index f75c99a8..c20e3edf 100644 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ * Plugin Name: Newsletter Builder * Plugin URI: https://github.com/alleyinteractive/wp-newsletter-builder * Description: Interface to manage email newsletters - * Version: 0.3.30 + * Version: 0.3.31 * Author: Alley Interactive * Author URI: https://github.com/alleyinteractive/wp-newsletter-builder * Requires at least: 6.2 From 13d8c14f5e321e9645b255afb5dc20beee7f0889 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Wed, 26 Jun 2024 11:34:19 -0400 Subject: [PATCH 4/4] lint --- src/class-settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class-settings.php b/src/class-settings.php index 73708e20..629b94b9 100644 --- a/src/class-settings.php +++ b/src/class-settings.php @@ -95,7 +95,7 @@ public function register_fields(): void { 'label' => __( 'Company Address Line 1', 'wp-newsletter-builder' ), ] ), - 'address_2' => new \Fieldmanager_TextField( + 'address_2' => new \Fieldmanager_TextField( [ 'label' => __( 'Company Address Line 2', 'wp-newsletter-builder' ), ]