开发者 | samuelaguilera |
---|---|
更新时间 | 2025年5月19日 23:54 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.8.1 |
版权: | GPLv3 |
版权网址: | 版权信息 |
As stated on this plugin description it supports the LiteSpeed Cache plugin, NOT LiteSpeed server directly. So if you're using a LiteSpeed based web host, you need to install LiteSpeed Cache plugin before installing Fresh Forms for Gravity.
ACF fields of the following types are supported as standalone fields and also as subfields of a Flexible Content or Repeater field: Text, Text Area, WYSIWYG. But this is disabled by default. To enable ACF support go to the settings page at Forms > Settings > Fresh Forms.
Starting with Fresh Forms 1.5 you can add a list of pages or posts IDs where you would like to force Fresh Forms to run by going to Forms > Settings > Fresh Forms.
You could also add the freshforms_post_has_gform filter in your theme functions.php file or a custom fucntionatliy plugin to pass Fresh Forms an array containing the ID of the pages/posts where you want it to run without performing the usual automatic detection of forms.
The following example would exclude posts with ID 1 and 8:
add_filter( 'freshforms_post_has_gform', 'fffg_fresh_these_posts' ); function fffg_fresh_these_posts(){ // Force Fresh Forms to run for posts with id 1 and 8. return array( 1, 8); }
The following example would exclude WooCommerce products using a product category with the slug product-category-1
`add_filter( 'freshforms_post_has_gform', 'fffg_fresh_these_products' );
function fffg_fresh_these_products( $post_has_form ){
global $post;
// Run Fresh Forms for a WooCommerce product if it has one of the following categories slugs.
$product_categories = array( 'product-category-1' );
if ( is_object( $post ) && 'product' === $post->post_type && has_term( $product_categories, 'product_cat', $post->ID ) ) {
return array( $post->ID );
}
// Otherwise.
return $post_has_form;
}`
After doing the above, you need to flush your host/plugin and browser cache.
Fresh Forms targets only WordPress caching plugins, it doesn't communicate with your server directly. If you have a WordPress installed to manage Varnish cache and this plugin has support for the DONOTCACHEPAGE constant, Fresh Forms should work out of the box.
But there are some WordPress plugins, like Breeze by CloudWays and NitroPack, that while they are created to integrate WordPress with Varnish, they don't support DONOTCACHEPAGE or provide any WordPress filters to exclude content dynamically (at the time of writing this).
But both have support to exclude pages from their cache based on a cookie added. Since Fresh Forms 1.3.4, you can use the freshforms_add_cookie filter in your theme functions.php file or a custom fucntionatliy plugin to make Fresh Forms to add a cookie that you can configure in CloudWays or NitroPack account dashboard.
add_filter( 'freshforms_add_cookie', '__return_true' );
Once you have the filter added to your site, follow the instructions below.
CloudWays documentation: How to Include or Exclude Cookies From Varnish
Make sure you select Exclude for the Method, and use FreshForms for the cookie Value.
NitroPack documentation: Excluded Cookies
Use FreshForms for the Cookie Name and no-cache for the Cookie Values.
After doing the above, you need to flush your host and browser cache.
wp doctor check autoload-options-size
is used. Thanks to @bozzmedia for the report.