diff --git a/.monorepo-source.json b/.monorepo-source.json index 5b2f84a..23b5df1 100644 --- a/.monorepo-source.json +++ b/.monorepo-source.json @@ -1,7 +1,7 @@ { "productId": "funkycommerce-headless", "repository": "coded-letter/superfunky-theme", - "source": "coded-letter/coded-letter-monorepo@4bd66b81aefe8683e36c4dc7e2106c9ab8b92b7d", + "source": "coded-letter/coded-letter-monorepo@2231c3290f97130c7f5a40820f205c0fb65f5687", "sourcePath": "workspace/backend/wordpress/themes/free/funkycommerce-headless", "installSlug": "funkycommerce-headless", "kind": "theme", diff --git a/functions.php b/functions.php index 39af708..05e1a49 100644 --- a/functions.php +++ b/functions.php @@ -9,7 +9,7 @@ exit; } -define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.30' ); +define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.31' ); /** * Whether Superfunky Pro is active and licensed. diff --git a/inc/artifact-renderer.php b/inc/artifact-renderer.php index 613498b..b31ff00 100644 --- a/inc/artifact-renderer.php +++ b/inc/artifact-renderer.php @@ -298,6 +298,24 @@ private static function resolve_current_singular_route( $path ) { } FunkyCommerce_Artifact_Store::record_worker_trace( $path, 'singular-resolving', 0 ); + if ( preg_match( '#^(?:[a-z]{2}(?:-[a-z0-9]+)*/)?blog/([^/]+)$#i', $request, $post_match ) ) { + $post = self::find_public_post_by_path( $post_match[1], array( 'post' ) ); + if ( + $post instanceof WP_Post + && 'publish' === $post->post_status + && '' === (string) $post->post_password + && $path === self::frontend_post_path( $post ) + ) { + return array( + 'kind' => 'post', + 'path' => $path, + 'query' => null, + 'object' => $post, + 'canonical' => self::frontend_url( $path ), + ); + } + } + $post_type_objects = get_post_types( array( 'publicly_queryable' => true ), 'objects' ); unset( $post_type_objects['attachment'] ); if ( empty( $post_type_objects ) ) { @@ -310,12 +328,6 @@ private static function resolve_current_singular_route( $path ) { 'types' => array_keys( $post_type_objects ), ), ); - if ( preg_match( '#^(?:[a-z]{2}(?:-[a-z0-9]+)*/)?blog/([^/]+)$#i', $request, $post_match ) ) { - $candidates[] = array( - 'path' => $post_match[1], - 'types' => array( 'post' ), - ); - } foreach ( $post_type_objects as $post_type => $post_type_object ) { $rewrite_slug = is_array( $post_type_object->rewrite ?? null ) ? trim( (string) ( $post_type_object->rewrite['slug'] ?? '' ), '/' ) diff --git a/package-lock.json b/package-lock.json index 983ae7c..b07aad9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "funkycommerce-headless-theme", - "version": "1.2.30", + "version": "1.2.31", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "funkycommerce-headless-theme", - "version": "1.2.30", + "version": "1.2.31", "devDependencies": { "autoprefixer": "^10.4.20", "esbuild": "^0.28.2", diff --git a/package.json b/package.json index d776c0d..dc7ef31 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "funkycommerce-headless-theme", "private": true, - "version": "1.2.30", + "version": "1.2.31", "description": "Tailwind/build tooling for the FunkyCommerce Headless WordPress theme's native frontend assets (block templates, template parts, loader, and Spotify slot).", "scripts": { "build:css": "tailwindcss -i ./assets/css/theme-source.css -o ./assets/dist/theme.css --minify", diff --git a/readme.txt b/readme.txt index f511b77..5812253 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: headless, woocommerce, wpgraphql, full-site-editing Requires at least: 6.7 Tested up to: 6.8 Requires PHP: 7.4 -Stable tag: 1.2.30 +Stable tag: 1.2.31 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -15,6 +15,10 @@ Control Center, the theme also ships a complete native WordPress rendering path "Native frontend theme" below) with accessible header/footer/navigation templates and core front/home/singular/archive/search/404 routes styled to match the storefront. +== 1.2.31 highlights == + +* Resolves canonical storefront blog posts before WordPress rewrite and old-slug redirect handling. + == 1.2.30 highlights == * Resolves canonical storefront blog routes to their published WordPress posts during artifact generation. diff --git a/style.css b/style.css index a98f3ba..ee9d96d 100644 --- a/style.css +++ b/style.css @@ -7,7 +7,7 @@ Description: A minimal, content-first block theme for polished WordPress preview Requires at least: 6.7 Tested up to: 6.8 Requires PHP: 7.4 -Version: 1.2.30 +Version: 1.2.31 Update URI: https://github.com/coded-letter/superfunky-theme License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html