From 67118cd6c0c850c7aa76abd8617e4dac5fe66538 Mon Sep 17 00:00:00 2001 From: Pascal Martineau Date: Wed, 24 Sep 2025 08:46:02 -0400 Subject: [PATCH] wip: dynamic preview --- .../themes/ccat/includes/vendors/acf.php | 30 +++++++++++++++++++ wp-content/themes/ccat/layouts/preview.php | 1 + .../ccat/server/api/acf-preview.post.ts | 3 ++ 3 files changed, 34 insertions(+) create mode 100644 wp-content/themes/ccat/layouts/preview.php create mode 100644 wp-content/themes/ccat/server/api/acf-preview.post.ts diff --git a/wp-content/themes/ccat/includes/vendors/acf.php b/wp-content/themes/ccat/includes/vendors/acf.php index 51aaacc..7584128 100644 --- a/wp-content/themes/ccat/includes/vendors/acf.php +++ b/wp-content/themes/ccat/includes/vendors/acf.php @@ -1,5 +1,35 @@ reset(); + acf_get_store( 'field-groups' )->reset(); + } +} + // Disable ACF / ACFE modules add_action( 'acf/init', 'ccat_acf_init' ); function ccat_acf_init() { diff --git a/wp-content/themes/ccat/layouts/preview.php b/wp-content/themes/ccat/layouts/preview.php new file mode 100644 index 0000000..f5ae4bf --- /dev/null +++ b/wp-content/themes/ccat/layouts/preview.php @@ -0,0 +1 @@ +
diff --git a/wp-content/themes/ccat/server/api/acf-preview.post.ts b/wp-content/themes/ccat/server/api/acf-preview.post.ts new file mode 100644 index 0000000..7187eea --- /dev/null +++ b/wp-content/themes/ccat/server/api/acf-preview.post.ts @@ -0,0 +1,3 @@ +export default defineEventHandler(() => { + return `
TODO: Preview from Nuxt API endpoint
`; +});