Load plugin only if needed and field is used

I wrote custom field as a plugin, it uses hooks and filters to work with gravity forms…

But now it’s loaded and hooked every time with every form, even if that field exits only in one form.

  1. What’s the best way to add it ONLY if the special field exists in the form
  2. And does the submit hooks also know the form we are submitting so that it’s not too late

using filters and add_action hooks like admin_init, gform_loaded, gform_field_validation, gform_enqueue_scripts and GF_Fields::register

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.