diff --git a/README.md b/README.md index 431e7f45..91e47c09 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Contributors: alleyinteractive Tags: alleyinteractive, wp-newsletter-builder -Stable tag: 0.3.6 +Stable tag: 0.3.22 Requires at least: 6.2 diff --git a/blocks/footer/edit.tsx b/blocks/footer/edit.tsx index 9c2d4605..9e61ff62 100644 --- a/blocks/footer/edit.tsx +++ b/blocks/footer/edit.tsx @@ -36,7 +36,7 @@ interface FooterSettings { * @return {WPElement} Element to render. */ export default function Edit() { - const [isLoading, setIsLoading] = useState(true); + const [isLoading, setIsLoading] = useState(false); const [footerSettings, setFooterSettings] = useState(); const facebookUrl = footerSettings?.facebook_url ?? ''; @@ -47,14 +47,14 @@ export default function Edit() { const address = footerSettings?.address ?? ''; useEffect(() => { - if (footerSettings) { - setIsLoading(false); - return; - } - apiFetch({ path: '/wp-newsletter-builder/v1/footer_settings' }).then((response) => { - setFooterSettings(response as any as FooterSettings); - }); - }, [footerSettings]); + setIsLoading(true); + + apiFetch({ path: '/wp-newsletter-builder/v1/footer_settings' }) + .then((response) => { + setFooterSettings(response as any as FooterSettings); + setIsLoading(false); + }); + }, []); const { media = null, diff --git a/blocks/footer/render.php b/blocks/footer/render.php index 5f426761..a38d43bd 100644 --- a/blocks/footer/render.php +++ b/blocks/footer/render.php @@ -18,6 +18,8 @@ $nb_image_id = $nb_footer_settings['image'] ?? 0; $nb_address = $nb_footer_settings['address'] ?? ''; $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' ); ?>
align="center"> @@ -26,7 +28,7 @@