Developers
Deze inhoud is nog niet vertaald.
CampaignSuite is built to be extended with standard WordPress actions and filters. This section lists every hook the two plugins currently offer.
| Plugin | What it does | Hooks |
|---|---|---|
| CampaignSuite Core | The platform: settings pages, CampaignSuite entries and payments, the background action queue, and the Salesforce/FinDock and Mautic connections. It contains no Gravity Forms code. | Core hooks |
| CampaignSuite Forms | Everything around Gravity Forms: the CampaignSuite fields, the Feed, FinDock, Prefill and Measurement add-ons, and one-click links. | Forms hooks |
Where to put your code
Section titled “Where to put your code”Add your callbacks to a small custom plugin (or a must-use plugin in wp-content/mu-plugins/) rather than to your theme, so they keep working when the theme changes.
<?php/** * Plugin Name: My CampaignSuite customisations */
add_filter('cs_action_max_attempts', function ($max_attempts) { return 5;});Load order
Section titled “Load order”- CampaignSuite Core loads on
plugins_loadedat the earliest priority, and CampaignSuite Forms loads right after it. - Code in CampaignSuite Forms that depends on Gravity Forms waits for Gravity Forms’
gform_loadedaction. - The
cs_initaction fires at the end of CampaignSuite Core’s own callback on the WordPressinitaction (priority 10). Add your callback before that: when your plugin file loads, onplugins_loaded, or oninitwith a priority below 10. - Most other hooks run later in the request, so you can also register them on
plugins_loadedorinit.
Naming conventions
Section titled “Naming conventions”- All hooks start with
cs_. Hooks in CampaignSuite Forms start withcs_forms_. - Some hook names are dynamic and are written here with a placeholder, for example
cs_entry_list_column_{column_name}orcs_forms_prevent_prefill_{form_id}. Replace the placeholder with the concrete value, such as a column name or a form ID. - Where a dynamic hook has a general counterpart (for example
cs_forms_prevent_prefillnext tocs_forms_prevent_prefill_{form_id}), the specific one runs first and the general one receives its result.