The plugin has to load all of the available forms when you enter the Edit Field Group screen in WordPress Admin, so that you can select the form which you want to include in the ACF output. This only has an effect in WordPress Admin, as this plugin has nothing to do with the frontend of the website. (Unless you’re using the acf_form function on public pages.)
Hi Mark,
I think I wasn’t clear enough,
Using Query Monitor, I found alot of queries executed on the homepage for example this query
SELECT *
FROM wp_6_gf_form
WHERE id=2 /* http://www.edntaiwan.com/ */
why these queries executed in homepage?
Thanks
I don’t know, sorry. That would most likely depend on the remainder of the code which you’re using on the website. This plugin doesn’t interfere with any content placed on the website. (Unless, as I wrote, you’re using the acf_form function on public pages.)
Hi,
we were able to reproduce this issue using version 1.2.7 and ACF Pro 5.9.4. I think the problem is that all forms are loaded in the __construct method of ACFGravityformsField\Field class:
public function __construct()
{
$this->name = 'forms';
$this->label = __('Forms', 'gravityforms');
$this->category = __('Relational', 'acf');
$this->defaults = [
'return_format' => 'form_object',
'multiple' => 0,
'allow_null' => 0
];
// Get our notices up and running
$this->notices = new Notices();
if (class_exists('GFAPI')) {
$this->forms = GFAPI::get_forms();
}
// Execute the parent constructor as well
parent::__construct();
}
We fixed it temporarily by replacing the condition in __construct method:
if (class_exists('GFAPI') && is_admin()) {
$this->forms = GFAPI::get_forms();
}
Ideally $this->forms should be replaced with method which loads forms dynamically when needed.
Please try version 1.2.8, which is now available in the plugin repository.
@all Thanks for your help
Version 1.2.8 resolves this support request.