Registering Add-on Settings
Ignition Crowdfunding gives add-ons a single, consistent home for their settings: the Add-ons tab under Ignition > Settings. When your add-on registers a settings page, core surfaces it in three places automatically — a Settings row action on the Add-ons tab, a dedicated detail sub-page, and a Settings link on your add-on’s row on the WordPress Plugins screen — with no extra wiring on your part.
1. Register your page on the filter
Section titled “1. Register your page on the filter”Core builds the registry of add-on settings pages by applying the igcf_addon_settings filter. Add an entry keyed by your add-on’s slug, whose value is a callable that renders the settings form:
add_filter( 'igcf_addon_settings', function ( $pages ) { $pages['my-addon'] = 'my_addon_render_settings'; return $pages;} );- The slug must match
^[a-z0-9-]+$(lowercase letters, numbers, and hyphens). It is sanitized withsanitize_key(), and it is what appears in the detail sub-page URL. - The value is any callable. Malformed entries (non-string keys or non-callable values) are dropped silently — a missing page degrades to “no settings,” never a fatal error.
2. Render the form
Section titled “2. Render the form”Your callback receives no arguments and echoes the form body. Core renders the page chrome (a heading and a back link to the Add-ons tab) around it; you own the fields. The simplest approach is the standard WordPress Settings API pointed at your own option:
function my_addon_render_settings() { echo '<form action="' . esc_url( admin_url( 'options.php' ) ) . '" method="post">'; settings_fields( 'my_addon_settings_group' ); do_settings_sections( 'my-addon-settings' ); submit_button(); echo '</form>';}Register your option and fields with register_setting() / add_settings_section() / add_settings_field() as usual. Because the form posts to options.php, WordPress handles the nonce and the capability check for you. That check is manage_options (administrators only), unless you open some of your settings to operators as described in step 4.
3. Make sure your add-on is in the catalog
Section titled “3. Make sure your add-on is in the catalog”The Settings link on the Plugins screen only appears for add-ons core knows about — that is, add-ons present in the Add-ons catalog with a plugin_file. Core’s first-party add-ons are in the curated catalog already. A third-party add-on can add itself at runtime through the igcf_addons_catalog filter:
add_filter( 'igcf_addons_catalog', function ( $catalog ) { $catalog[] = array( 'slug' => 'my-addon', 'name' => __( 'My Add-on', 'my-addon' ), 'description' => __( 'What it does, in one line.', 'my-addon' ), 'plugin_file' => 'my-addon/my-addon.php', 'download_url' => 'https://example.com/my-addon', 'version' => '1.0.0', ); return $catalog;} );Settings registration and catalog membership are independent: an add-on can register a settings page without being in the catalog (it just won’t get the Plugins-screen link), and it can appear in the catalog without registering settings.
4. Let operators change some settings
Section titled “4. Let operators change some settings”By default only administrators can open your page and save your option. An operator runs the fundraising without an administrator login. To let operators change some of your settings, typically business settings such as a limit or a message, declare those keys on igcf_operator_settings:
add_filter( 'igcf_operator_settings', function ( $map ) { $map['my_addon_settings'] = array( 'group' => 'my_addon_settings_group', 'keys' => array( 'max_items', 'notice_*' ), 'addon' => 'my-addon', ); return $map;} );Once you declare at least one key:
- Your add-on appears on an operator’s Settings > Add-ons tab, and its sub-page opens for them. An operator’s Add-ons tab lists only add-ons that declare keys.
options.phpaccepts their save of your group, checkingigcf_manage_settingsinstead ofmanage_options.- Every key you didn’t list keeps its stored value when an operator saves, even if their request carries a new value. Keep technical settings such as API keys, webhook secrets and anything that decides where money goes off the list.
The save is protected regardless of what the form shows. Hide fields an operator can’t change, so they aren’t shown a control that does nothing:
if ( Igcf_Settings_Guard::can_edit( 'my_addon_settings', 'api_key' ) ) { add_settings_field( 'api_key', __( 'API key', 'my-addon' ), 'my_addon_render_api_key', 'my-addon-settings', 'my_addon_main' );}Where it appears
Section titled “Where it appears”Once registered, your settings page is reachable from:
- Ignition > Settings > Add-ons — a Settings link on your add-on’s row.
- Ignition > Settings > Add-ons → your add-on — the detail sub-page at
?page=igcf-settings&tab=addons&addon={slug}. - Plugins screen — a Settings link on your add-on’s row (when your add-on is in the catalog).
Operators reach the first two only when your add-on declares operator keys (step 4).
Related references
Section titled “Related references”igcf_addon_settingsandigcf_addons_catalog— the filters this recipe uses.igcf_operator_settings— which of your settings operators may change.- Administration → Add-ons — the administrator-facing view of the Add-ons tab.
- Registering a Payment Gateway — gateways get their own settings sub-pages on the Payments tab through a parallel mechanism.