| 开发者 | rickey29 |
|---|---|
| 更新时间 | 2026年11月19日 23:16 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
FLX_MODERNIZE_WOOCOMMERCE in wp-config.php. It needs the Storefront theme, the Astra theme (4.14, without a child theme) or the Flatsome theme (3.18.2; a child theme only with styles and functions.php), and a Render service that draws that theme: the Storefront renderer package, or an Astra or Flatsome renderer built for your site. Any other theme, or a theme or WooCommerce template this release wasn't reviewed against, stays normal WordPress.
FLX_MODERNIZE_WOOCOMMERCE_SHELL, puts the site's header and footer from the Render service around the Cart and a guest's My account page, and FLX_MODERNIZE_WOOCOMMERCE_SHELL_CHECKOUT does the same for Checkout. WordPress fills in these pages on your own server, so their contents are never sent. What comes from the Render service for these pages must pass a strict check, built on WordPress 6.9's output buffer: no scripts and no forms. If it doesn't pass, or on older WordPress, these pages stay normal WordPress. If you take real payments, ask your payment provider or assessor before turning on Checkout.FLX_MODERNIZE_LOGGED_IN_CUSTOMERS. Then they get the same catalogue pages as a guest, built the same way with nothing about them sent; WordPress marks the page as logged in and hides the review form's name and email fields, which come from their account; on Astra it also puts the customer's own account link or avatar in the header. These changes are made on your server. Everything else stays normal WordPress for them, and anyone who can edit content or run the store always does. Leave it off if your prices or products differ per customer (memberships, wholesale or role-based prices).Cache-Control: private, no-store, unless you turn on edge caching (below). A page served by WordPress because the Render service failed is always sent with no-store.FLX_MODERNIZE_LOOPBACK_FALLBACK to false in wp-config.php turns the fresh fetch off.FLX_MODERNIZE_EDGE_TTL, 60–3600 seconds), Flx pages that are the same for every visitor (pages, posts, the blog home page, category and tag archives, without a query string) can be stored by your CDN. Search results, the 404 page, URLs with a query string, fallback pages and everything WordPress renders itself are never cached.
With a Cloudflare zone ID and a purge-only API token, any change that can show on a page clears your site from Cloudflare's cache, and Cloudflare can serve an expired copy once while it fetches a fresh one (stale-while-revalidate), so no visitor waits. WooCommerce stores can also cache the shop, category and product pages for at most 5 minutes (Store pages in the edge cache); Cart, Checkout, My account and shoppers with something in their cart never are.
Settings, filters, the CDN rules (including the cart cookies to skip) and the Cloudflare Cache Rule are in the documentation.
For developers
The flx_modernize_should_render filter lets you turn Flx off for a request (return false). It can never turn Flx on for a logged-in user.
The flx_modernize_head_footer_output filter turns off the head and footer output (return false).
Documentation and a step-by-step tutorial for building a renderer for a theme are at modernize.flexplat.com.
FLX_RENDER_SIGNING_KEYS setting.?flx-preview=… to other pages' addresses to check them. Visitors keep normal WordPress until you untick Preview only and save.wp-config.php instead (see the documentation); a constant takes priority, and the screen then shows that setting read-only. A secret saved on the screen is stored in the WordPress database; wp-config.php keeps it out of the database.Twenty Twenty-Five; Hello Elementor, for pages built with the free Elementor plugin (see "Elementor" above); and, for WooCommerce stores that opt in, Storefront and Astra. Each theme needs a renderer that knows its design; the tutorial at modernize.flexplat.com shows how one is built.
WordPress renders the page itself, automatically, and sends it with Cache-Control: no-store so the fallback page is not cached.
Because you are logged in. Flx serves anonymous visitors only. Open the site in a private window to see the Flx pages.
Flx pages tell page-cache plugins not to store them (DONOTCACHEPAGE) and send Cache-Control: private, no-store. To cache Flx pages at your CDN instead, turn on edge caching (see the Description).
The header menu, with custom, page, post and category links, and sub-menus up to three levels deep (they open on hover and keyboard focus).
No. On a site with WooCommerce, your pages and posts are served through Flx as usual, while the store (shop, products, cart, checkout and My account) and shoppers with something in their cart get normal WordPress, unless the site opts in; see "WooCommerce stores" above.
es-ES) on the page, as WordPress prints them. Images above the main content are no longer lazy-loaded. Found in the first preview on a live Flatsome store; other themes are unchanged.FLX_MODERNIZE_PREVIEW_ONLY). With a Render URL saved, every visitor keeps normal WordPress pages; only a secret preview link (?flx-preview=…, shown on the screen) shows Flx pages, so you can check them before going live. Preview pages are never cached or indexed, and the link is not passed on to other sites. New preview link makes earlier links stop working. Untick it to make Flx pages live for everyone.functions.php), with a Render service built for your site. Pages on the "Page - Full Width" template, the shop, product categories and products go through Flx with Flatsome's header and footer as WordPress prints them; other page templates, posts, archives, search and logged-in users stay normal WordPress. Another Flatsome version keeps the whole site on normal WordPress.Cloudflare-CDN-Cache-Control with stale-while-revalidate), so no visitor waits for an expired copy. A purge still removes the copy at once.flx_modernize_stale_while_revalidate filter changes it (0 turns it off). Cache-Control is unchanged, and other CDNs ignore the new header.FLX_MODERNIZE_STORE_EDGE_CACHE). The shop, product category, tag and product pages that Flx renders can now be stored by your CDN, for at most 5 minutes. Off by default; it needs the store opt-in, an edge cache time and the Cloudflare purge.flx_modernize_store_route_cacheable filter can turn store caching off, for example with a multi-currency plugin.wp-config.php keep priority and are shown read-only, so sites that use them see no change.wp-config.php.FLX_MODERNIZE_LOGGED_IN_CUSTOMERS) get these catalogue pages too, with their own account link or avatar in the header, made on your server.false from flx_modernize_head_footer_output now keeps every page normal WordPress, not only the store's pages.no-store. If your server cannot reach its own address, the page is served as before. FLX_MODERNIZE_LOOPBACK_FALLBACK set to false turns this off.FLX_MODERNIZE_LOGGED_IN_CUSTOMERS (off by default) gives logged-in customers the same catalogue pages as guests. Nothing about the customer is sent to the Render service; editors and shop managers keep normal WordPress.FLX_MODERNIZE_WOOCOMMERCE, off by default): the shop, product categories and tags, products and Storefront's home page go through Flx, including for shoppers with a cart. Page data is built with an empty cart and no customer data; WooCommerce's scripts fill in the cart in the browser. A template this release wasn't reviewed against stays normal WordPress.FLX_MODERNIZE_WOOCOMMERCE_SHELL, and FLX_MODERNIZE_WOOCOMMERCE_SHELL_CHECKOUT for Checkout; WordPress 6.9 or later): the Cart, Checkout and a guest's My account inside the site's header and footer from the Render service. Built in advance with no visitor data, checked against a strict allowlist, and filled in by WordPress on your server.no-store). Changing the Render URL or signing key clears this at once.author_url, categories, tags, previous, next, more_posts; renderer package 1.5.0 or later).comments_html, renderer package 1.4.0 or later). Form plugins keep working. Visitors who have commented, and reply or "awaiting moderation" links, get normal WordPress. The filter flx_modernize_comments_html can change or remove the section.more_posts, the four latest posts; renderer package 1.4.0 or later).language, as in get_bloginfo( 'language' )), so Flx pages have the right <html lang> (renderer package 1.3.0 or later). Renderer package 1.3.0 also adds the "Skip to content" link.FLX_MODERNIZE_EDGE_TTL in wp-config.php, pages, posts, the blog home page and category and tag archives without a query string are sent public, max-age=0, s-maxage=<TTL> so a CDN can store them. Search, 404, query strings, fallback pages and logged-in users are never cached.FLX_MODERNIZE_CLOUDFLARE_ZONE_ID, FLX_MODERNIZE_CLOUDFLARE_API_TOKEN).wp_head and wp_footer are sent to the Render service (head_html, footer_html), so SEO plugins such as Yoast work on Flx pages. Filter flx_modernize_head_footer_output turns it off.Cache-Control: private, no-store on Flx pages and no-store on fallback pages; DONOTCACHEPAGE for page-cache plugins.flx_modernize_should_render filter to turn Flx off for a request.