From 69c2825b3780a118e949d61f7a8cefbd9e9aa553 Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Sat, 23 Aug 2025 10:54:01 +0700 Subject: [PATCH 01/10] Use external hero image --- parts/header.html | 6 ++++- templates/home.html | 62 +++++++++++++++++++++++++------------------ theme.json | 64 ++++++++++++++++++++++----------------------- 3 files changed, 73 insertions(+), 59 deletions(-) diff --git a/parts/header.html b/parts/header.html index 8e4f17be..ce076dbb 100644 --- a/parts/header.html +++ b/parts/header.html @@ -3,7 +3,11 @@
- + + + + +
diff --git a/templates/home.html b/templates/home.html index 8fe7845e..63fbe342 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,35 +1,45 @@ - -
- + +
+ +
Woman working at a computer
+ - -
- - - - - + +
+ +

Section One

+ + +

Content for the first section.

+ +
+ - - - - + +
+ +

Section Two

+ + +

Content for the second section.

+ +
+ - - - - -
- - - - - - - + +
+ +

Section Three

+ + +

Content for the third section.

+ +
+
+ diff --git a/theme.json b/theme.json index 20f203a1..6f2964e6 100644 --- a/theme.json +++ b/theme.json @@ -10,16 +10,16 @@ "defaultPalette": false, "duotone": [], "palette": [ - { - "name": "Background", - "slug": "background", - "color": "#FEFEFE" - }, - { - "name": "Foreground", - "slug": "foreground", - "color": "#181A1F" - }, + { + "name": "Background", + "slug": "background", + "color": "#E06547" + }, + { + "name": "Foreground", + "slug": "foreground", + "color": "#FFFFFF" + }, { "name": "Primary", "slug": "primary", @@ -320,35 +320,35 @@ "lineHeight": "1.2" } }, - "link": { - ":hover": { - "color": { - "text": "var:preset|color|foreground" + "link": { + ":hover": { + "color": { + "text": "var:preset|color|foreground" + }, + "typography": { + "textDecoration": "underline var(--wp--preset--color--foreground)" + } + }, + ":focus": { + "typography": { + "textDecoration": "underline dashed" + } + }, + ":active": { + "color": { + "text": "var:preset|color|foreground" + }, + "typography": { + "textDecoration": "none" + } }, - "typography": { - "textDecoration": "underline var(--wp--preset--color--foreground)" - } - }, - ":focus": { - "typography": { - "textDecoration": "underline dashed" - } - }, - ":active": { "color": { "text": "var:preset|color|foreground" }, "typography": { - "textDecoration": "none" + "textDecoration": "underline var(--wp--preset--color--foreground)" } - }, - "color": { - "text": "var:preset|color|primary" - }, - "typography": { - "textDecoration": "underline var(--wp--preset--color--primary)" } - } }, "spacing": { "blockGap": "var:custom|block-gap", From 1bce9acfd020f7a0d2e568f6a0bf565eb077a102 Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Sat, 23 Aug 2025 11:12:40 +0700 Subject: [PATCH 02/10] Make home image full-width with wave border --- style.css | 24 ++++++++++++++++++++++++ templates/home.html | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/style.css b/style.css index 05f99a7a..506cef33 100644 --- a/style.css +++ b/style.css @@ -11,3 +11,27 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.html Tags: Text Domain: block-theme */ + +/* Make images with the wave-border class span the full width and add a simple wave at the bottom */ +.wave-border { + position: relative; + overflow: hidden; +} + +.wave-border img { + width: 100%; + height: auto; + display: block; +} + +.wave-border .wave { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 40px; +} + +.wave-border .wave path { + fill: var(--wp--preset--color--background, #ffffff); +} diff --git a/templates/home.html b/templates/home.html index 63fbe342..803e4e3d 100644 --- a/templates/home.html +++ b/templates/home.html @@ -2,8 +2,8 @@
- -
Woman working at a computer
+ +
Woman working at a computer
From d5b552ce8dfcd538c6387bc31dc60469fd24314e Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Tue, 26 Aug 2025 16:24:22 +0700 Subject: [PATCH 03/10] feat: add wave hero and marketing intro --- style.css | 27 +++++--------- templates/home.html | 90 +++++++++++++++++++++++++++++---------------- 2 files changed, 69 insertions(+), 48 deletions(-) diff --git a/style.css b/style.css index 506cef33..158b3a01 100644 --- a/style.css +++ b/style.css @@ -12,26 +12,19 @@ Tags: Text Domain: block-theme */ -/* Make images with the wave-border class span the full width and add a simple wave at the bottom */ -.wave-border { - position: relative; - overflow: hidden; -} - -.wave-border img { +/* Styles for wave-shaped hero image and feature icons */ +.wave-border svg { width: 100%; height: auto; display: block; } -.wave-border .wave { - position: absolute; - bottom: 0; - left: 0; - width: 100%; - height: 40px; -} - -.wave-border .wave path { - fill: var(--wp--preset--color--background, #ffffff); +.icon { + width: 64px; + height: 64px; + display: block; + margin-left: auto; + margin-right: auto; + margin-bottom: var(--wp--preset--spacing--20); + color: var(--wp--preset--color--primary, #000); } diff --git a/templates/home.html b/templates/home.html index 803e4e3d..53bcfc53 100644 --- a/templates/home.html +++ b/templates/home.html @@ -2,42 +2,70 @@
- -
Woman working at a computer
- - - -
- -

Section One

- - -

Content for the first section.

- + +
+ + + + + + + + + +
- -
- -

Section Two

- - -

Content for the second section.

- -
- + +

We craft digital marketing experiences that help small businesses grow and connect with their customers.

+ - -
- -

Section Three

- - -

Content for the third section.

- + +
+ +
+ + + + +

Who I Am

+ + +

A dedicated marketer passionate about elevating small businesses.

+ +
+ + + +
+ + + + +

What I Do

+ + +

Strategic campaigns and content that turn clicks into customers.

+ +
+ + + +
+ + + + +

Results

+ + +

Data-driven outcomes that grow your revenue and reach.

+ +
+
- +
From ca8996c4c2824de09edd1d7f95e3635576d508eb Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Thu, 28 Aug 2025 15:15:54 +0700 Subject: [PATCH 04/10] Add responsive wave hero and logo carousel --- src/js/scripts.js | 14 +++ src/scss/components/home.scss | 26 ++++ src/scss/components/index.scss | 1 + templates/home.html | 219 ++++++++++++++++++++++++--------- 4 files changed, 199 insertions(+), 61 deletions(-) create mode 100644 src/scss/components/home.scss diff --git a/src/js/scripts.js b/src/js/scripts.js index e69de29b..352b8a12 100644 --- a/src/js/scripts.js +++ b/src/js/scripts.js @@ -0,0 +1,14 @@ +document.addEventListener('DOMContentLoaded', () => { + const slides = document.querySelectorAll('.logo-carousel .logo-slide'); + let index = 0; + + if (slides.length > 0) { + slides[index].classList.add('active'); + + setInterval(() => { + slides[index].classList.remove('active'); + index = (index + 1) % slides.length; + slides[index].classList.add('active'); + }, 3000); + } +}); diff --git a/src/scss/components/home.scss b/src/scss/components/home.scss new file mode 100644 index 00000000..8ba83996 --- /dev/null +++ b/src/scss/components/home.scss @@ -0,0 +1,26 @@ +.wave-border svg { + width: 100%; + height: auto; + display: block; +} + +.logo-carousel { + position: relative; + width: 100%; + max-width: 100%; + overflow: hidden; + text-align: center; +} + +.logo-slide { + display: none; +} + +.logo-slide img { + max-width: 100%; + height: auto; +} + +.logo-slide.active { + display: block; +} diff --git a/src/scss/components/index.scss b/src/scss/components/index.scss index e69de29b..4de78604 100644 --- a/src/scss/components/index.scss +++ b/src/scss/components/index.scss @@ -0,0 +1 @@ +@forward "home"; diff --git a/templates/home.html b/templates/home.html index 53bcfc53..bd80e6f8 100644 --- a/templates/home.html +++ b/templates/home.html @@ -2,72 +2,169 @@
- -
- - - - - - - - - - -
- + +
+ + + + + + + + + + +
+ - -

We craft digital marketing experiences that help small businesses grow and connect with their customers.

- + +
+ +

+ We craft digital marketing experiences that help small businesses + grow and connect with their customers. +

+ - -
- -
- - - - -

Who I Am

- - -

A dedicated marketer passionate about elevating small businesses.

- -
- + +
+ +
+ + + + + + + +

Who I Am

+ + +

+ A dedicated marketer passionate about elevating small + businesses. +

+ +
+ - -
- - - - -

What I Do

- - -

Strategic campaigns and content that turn clicks into customers.

- -
- + +
+ + + + + + +

What I Do

+ + +

+ Strategic campaigns and content that turn clicks into + customers. +

+ +
+ - -
- - - - -

Results

- - -

Data-driven outcomes that grow your revenue and reach.

- -
- -
- + +
+ + + + + + + +

Results

+ + +

+ Data-driven outcomes that grow your revenue and reach. +

+ +
+ +
+ + + + + +
+
- From 4a43ac17e142971f69e3bca6c452d9c2cda57a49 Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Thu, 28 Aug 2025 15:55:50 +0700 Subject: [PATCH 05/10] Refine homepage layout and carousel --- src/scss/components/home.scss | 33 +++++-- style.css | 36 +++++++- templates/home.html | 158 +++++++++++++++++++--------------- 3 files changed, 144 insertions(+), 83 deletions(-) diff --git a/src/scss/components/home.scss b/src/scss/components/home.scss index 8ba83996..5f14411c 100644 --- a/src/scss/components/home.scss +++ b/src/scss/components/home.scss @@ -1,15 +1,32 @@ +body { + background-color: #ffffff; + color: #000000; +} + +.wave-border { + background-color: #ffffff; +} + .wave-border svg { - width: 100%; - height: auto; - display: block; + width: 100%; + height: auto; + display: block; +} + +.icon { + width: 64px; + height: 64px; + display: block; + margin: 3cm; + color: var(--wp--preset--color--primary, #000); } .logo-carousel { - position: relative; - width: 100%; - max-width: 100%; - overflow: hidden; - text-align: center; + position: relative; + width: 100%; + max-width: 100%; + overflow: hidden; + text-align: center; } .logo-slide { diff --git a/style.css b/style.css index 158b3a01..96336811 100644 --- a/style.css +++ b/style.css @@ -12,7 +12,16 @@ Tags: Text Domain: block-theme */ -/* Styles for wave-shaped hero image and feature icons */ +/* Styles for wave-shaped hero image, icons, and logo carousel */ +body { + background-color: #ffffff; + color: #000000; +} + +.wave-border { + background-color: #ffffff; +} + .wave-border svg { width: 100%; height: auto; @@ -23,8 +32,27 @@ Text Domain: block-theme width: 64px; height: 64px; display: block; - margin-left: auto; - margin-right: auto; - margin-bottom: var(--wp--preset--spacing--20); + margin: 3cm; color: var(--wp--preset--color--primary, #000); } + +.logo-carousel { + position: relative; + width: 100%; + max-width: 100%; + overflow: hidden; + text-align: center; +} + +.logo-slide { + display: none; +} + +.logo-slide img { + max-width: 100%; + height: auto; +} + +.logo-slide.active { + display: block; +} diff --git a/templates/home.html b/templates/home.html index bd80e6f8..1113bf50 100644 --- a/templates/home.html +++ b/templates/home.html @@ -3,13 +3,13 @@
-
- - +
+ + - - - -
- + + + +
+ - +
+ color: #000000; + background-color: #ffffff; + padding-top: var(--wp--preset--spacing--60); + padding-bottom: var(--wp--preset--spacing--60); + " + >

We craft digital marketing experiences that help small businesses @@ -54,20 +54,16 @@

- - - - - + + + +

Who I Am

@@ -83,21 +79,16 @@

Who I Am

- - - - + + + +

What I Do

@@ -113,20 +104,16 @@

What I Do

- - - - - + + + +

Results

@@ -161,9 +148,38 @@

Results

/>
- -
- + + + + +
+ + + +
+ + + + + +
+
From 48317ae176529750b1f46823286d89791f33f069 Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Thu, 28 Aug 2025 16:18:53 +0700 Subject: [PATCH 06/10] Add hero section with wave divider --- src/scss/components/home.scss | 62 +++++++++++++++++++++++++++----- style.css | 66 +++++++++++++++++++++++++++++------ templates/home.html | 40 ++++++++++----------- 3 files changed, 128 insertions(+), 40 deletions(-) diff --git a/src/scss/components/home.scss b/src/scss/components/home.scss index 5f14411c..5f6fe2e2 100644 --- a/src/scss/components/home.scss +++ b/src/scss/components/home.scss @@ -1,16 +1,62 @@ body { - background-color: #ffffff; - color: #000000; +background-color: #ffffff; +color: #000000; } -.wave-border { - background-color: #ffffff; +.hero-section { +position: relative; +background-size: cover; +background-position: center; +display: flex; +flex-direction: column; +justify-content: center; +align-items: center; +text-align: center; +min-height: 75vh; +color: #ffffff; } -.wave-border svg { - width: 100%; - height: auto; - display: block; +@media (max-width: 768px) { +.hero-section { +min-height: 65vh; +} +} + +.hero-section::before { +content: ""; +position: absolute; +top: 0; +left: 0; +right: 0; +bottom: 0; +background: rgba(0, 0, 0, 0.3); +z-index: 0; +} + +.hero-section .hero-content { +position: relative; +z-index: 1; +padding: 0 1rem; +} + +.hero-button .wp-block-button__link { +background: #E06547; +color: #ffffff; +border-radius: 9999px; +padding: 1rem 2rem; +transition: background-color 0.3s ease; +} + +.hero-button .wp-block-button__link:hover { +background: #cc563d; +} + +.hero-wave { +position: absolute; +bottom: -1px; +left: 0; +width: 100%; +height: auto; } .icon { diff --git a/style.css b/style.css index 96336811..0f38e396 100644 --- a/style.css +++ b/style.css @@ -18,16 +18,6 @@ body { color: #000000; } -.wave-border { - background-color: #ffffff; -} - -.wave-border svg { - width: 100%; - height: auto; - display: block; -} - .icon { width: 64px; height: 64px; @@ -56,3 +46,59 @@ body { .logo-slide.active { display: block; } + +.hero-section { + position: relative; + background-size: cover; + background-position: center; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; + min-height: 75vh; + color: #ffffff; +} + +@media (max-width: 768px) { + .hero-section { + min-height: 65vh; + } +} + +.hero-section::before { + content: ""; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.3); + z-index: 0; +} + +.hero-section .hero-content { + position: relative; + z-index: 1; + padding: 0 1rem; +} + +.hero-button .wp-block-button__link { + background: #E06547; + color: #ffffff; + border-radius: 9999px; + padding: 1rem 2rem; + transition: background-color 0.3s ease; +} + +.hero-button .wp-block-button__link:hover { + background: #cc563d; +} + +.hero-wave { + position: absolute; + bottom: -1px; + left: 0; + width: 100%; + height: auto; +} diff --git a/templates/home.html b/templates/home.html index 1113bf50..7a134c09 100644 --- a/templates/home.html +++ b/templates/home.html @@ -2,29 +2,25 @@
- -
+ +
+
+ +

Digital Marketing that Helps Small Businesses Grow

+ + +

We make marketing fun, effective, and stress-free—so you can focus on your business.

+ + + + +
- - - - - - - - +
From df79666063c01ec9c1e109497b874c411f59b45e Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Thu, 28 Aug 2025 16:40:26 +0700 Subject: [PATCH 07/10] Add hero section styling for Joy Marketing home page --- src/scss/components/home.scss | 17 ++++++++++------- style.css | 17 ++++++++++------- templates/home.html | 8 ++++---- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/scss/components/home.scss b/src/scss/components/home.scss index 5f6fe2e2..3adab14e 100644 --- a/src/scss/components/home.scss +++ b/src/scss/components/home.scss @@ -12,13 +12,13 @@ flex-direction: column; justify-content: center; align-items: center; text-align: center; -min-height: 75vh; +min-height: 80vh; color: #ffffff; } @media (max-width: 768px) { .hero-section { -min-height: 65vh; +min-height: 70vh; } } @@ -29,7 +29,7 @@ top: 0; left: 0; right: 0; bottom: 0; -background: rgba(0, 0, 0, 0.3); +background: rgba(0, 0, 0, 0.35); z-index: 0; } @@ -40,15 +40,18 @@ padding: 0 1rem; } .hero-button .wp-block-button__link { -background: #E06547; -color: #ffffff; +background: #ffffff; +color: #E06547; +border: none; border-radius: 9999px; padding: 1rem 2rem; -transition: background-color 0.3s ease; +transition: background-color 0.3s ease, color 0.3s ease; +box-shadow: none; } .hero-button .wp-block-button__link:hover { -background: #cc563d; +background: #E06547; +color: #ffffff; } .hero-wave { diff --git a/style.css b/style.css index 0f38e396..62617324 100644 --- a/style.css +++ b/style.css @@ -56,13 +56,13 @@ body { justify-content: center; align-items: center; text-align: center; - min-height: 75vh; + min-height: 80vh; color: #ffffff; } @media (max-width: 768px) { .hero-section { - min-height: 65vh; + min-height: 70vh; } } @@ -73,7 +73,7 @@ body { left: 0; right: 0; bottom: 0; - background: rgba(0, 0, 0, 0.3); + background: rgba(0, 0, 0, 0.35); z-index: 0; } @@ -84,15 +84,18 @@ body { } .hero-button .wp-block-button__link { - background: #E06547; - color: #ffffff; + background: #ffffff; + color: #E06547; + border: none; border-radius: 9999px; padding: 1rem 2rem; - transition: background-color 0.3s ease; + transition: background-color 0.3s ease, color 0.3s ease; + box-shadow: none; } .hero-button .wp-block-button__link:hover { - background: #cc563d; + background: #E06547; + color: #ffffff; } .hero-wave { diff --git a/templates/home.html b/templates/home.html index 7a134c09..a10e7722 100644 --- a/templates/home.html +++ b/templates/home.html @@ -5,11 +5,11 @@
- -

Digital Marketing that Helps Small Businesses Grow

+ +

Digital Marketing that Helps Small Businesses Grow

- -

We make marketing fun, effective, and stress-free—so you can focus on your business.

+ +

We make marketing fun, effective, and stress-free—so you can focus on your business.

From b8781f71ab9f0532135280e0e9be7198d8d38d2f Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Thu, 28 Aug 2025 16:49:53 +0700 Subject: [PATCH 08/10] Refine hero section design --- src/scss/components/home.scss | 4 ++-- style.css | 4 ++-- templates/home.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scss/components/home.scss b/src/scss/components/home.scss index 3adab14e..581eba52 100644 --- a/src/scss/components/home.scss +++ b/src/scss/components/home.scss @@ -12,13 +12,13 @@ flex-direction: column; justify-content: center; align-items: center; text-align: center; -min-height: 80vh; +min-height: 75vh; color: #ffffff; } @media (max-width: 768px) { .hero-section { -min-height: 70vh; +min-height: 65vh; } } diff --git a/style.css b/style.css index 62617324..4d735772 100644 --- a/style.css +++ b/style.css @@ -56,13 +56,13 @@ body { justify-content: center; align-items: center; text-align: center; - min-height: 80vh; + min-height: 75vh; color: #ffffff; } @media (max-width: 768px) { .hero-section { - min-height: 70vh; + min-height: 65vh; } } diff --git a/templates/home.html b/templates/home.html index a10e7722..2e85e6d0 100644 --- a/templates/home.html +++ b/templates/home.html @@ -3,7 +3,7 @@
-
+

Digital Marketing that Helps Small Businesses Grow

From 63804528f8ab23e3384b27ebf39057633d085ef2 Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Tue, 2 Sep 2025 16:01:00 +0700 Subject: [PATCH 09/10] Make hero image full-width --- src/scss/components/home.scss | 6 ++++++ style.css | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/scss/components/home.scss b/src/scss/components/home.scss index 581eba52..f41c919f 100644 --- a/src/scss/components/home.scss +++ b/src/scss/components/home.scss @@ -16,6 +16,12 @@ min-height: 75vh; color: #ffffff; } +.hero-section.alignfull { +width: 100vw; +margin-left: calc(50% - 50vw); +margin-right: calc(50% - 50vw); +} + @media (max-width: 768px) { .hero-section { min-height: 65vh; diff --git a/style.css b/style.css index 4d735772..8804b5b6 100644 --- a/style.css +++ b/style.css @@ -60,6 +60,12 @@ body { color: #ffffff; } +.hero-section.alignfull { + width: 100vw; + margin-left: calc(50% - 50vw); + margin-right: calc(50% - 50vw); +} + @media (max-width: 768px) { .hero-section { min-height: 65vh; From f6fb2ccf5a5efedd61d4dd8935efbf50a22a5f4f Mon Sep 17 00:00:00 2001 From: Ric Hincapie Date: Thu, 4 Sep 2025 15:42:38 +0700 Subject: [PATCH 10/10] Handle missing asset files gracefully --- inc/enqueue.php | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/inc/enqueue.php b/inc/enqueue.php index 9ff4740d..17d2d0b8 100644 --- a/inc/enqueue.php +++ b/inc/enqueue.php @@ -3,6 +3,8 @@ * Enqueue scripts and styles. * * @package BlockTheme + * @subpackage Enqueue + * @author BlockTheme */ namespace BlockTheme\Enqueue; @@ -15,10 +17,13 @@ * @return void */ function global_theme_styles() { - $theme_version = wp_get_theme()->get( 'Version' ); - $css_version = $theme_version . '.' . filemtime( get_template_directory() . '/css/global.css' ); + $css_file = get_template_directory() . '/css/global.css'; + if ( file_exists( $css_file ) ) { + $theme_version = wp_get_theme()->get( 'Version' ); + $css_version = $theme_version . '.' . filemtime( $css_file ); - wp_enqueue_style( 'block-theme-global-theme-style', get_template_directory_uri() . '/css/global.css', array(), $css_version ); + wp_enqueue_style( 'block-theme-global-theme-style', get_template_directory_uri() . '/css/global.css', array(), $css_version ); + } } add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\global_theme_styles' ); @@ -31,10 +36,14 @@ function global_theme_styles() { */ function front_end_scripts() { - $asset_file = include get_template_directory() . '/js/scripts.asset.php'; - $dependencies = $asset_file['dependencies']; + $asset_path = get_template_directory() . '/js/scripts.asset.php'; + if ( file_exists( $asset_path ) ) { + $asset_file = include $asset_path; + $dependencies = isset( $asset_file['dependencies'] ) ? $asset_file['dependencies'] : array(); + $version = isset( $asset_file['version'] ) ? $asset_file['version'] : false; - wp_enqueue_script( 'block-theme-front-end-scripts', get_template_directory_uri() . '/js/scripts.js', $dependencies, $asset_file['version'], true ); + wp_enqueue_script( 'block-theme-front-end-scripts', get_template_directory_uri() . '/js/scripts.js', $dependencies, $version, true ); + } } add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\front_end_scripts' ); @@ -48,8 +57,15 @@ function front_end_scripts() { * @return void */ function enqueue_editor_modifications() { - $asset_file = include get_template_directory() . '/js/editor.asset.php'; - $dependencies = $asset_file['dependencies']; + $asset_path = get_template_directory() . '/js/editor.asset.php'; + if ( ! file_exists( $asset_path ) ) { + return; + } + + $asset_file = include $asset_path; + $dependencies = isset( $asset_file['dependencies'] ) ? $asset_file['dependencies'] : array(); + + $version = isset( $asset_file['version'] ) ? $asset_file['version'] : false; // Add extra dependencies depending on the current screen. $screen = get_current_screen(); @@ -63,7 +79,7 @@ function enqueue_editor_modifications() { break; } - wp_enqueue_script( 'block-theme-editor-modifications', get_template_directory_uri() . '/js/editor.js', $dependencies, $asset_file['version'], true ); + wp_enqueue_script( 'block-theme-editor-modifications', get_template_directory_uri() . '/js/editor.js', $dependencies, $version, true ); } add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\enqueue_editor_modifications' );