Skip to content

Abilities Reference

Ignition Crowdfunding uses the WordPress Abilities API (introduced in WordPress 6.9) for campaign, pledge, and payment-gateway state-transition actions. Abilities are declaratively registered actions with built-in permission checks, input/output schemas, and a standardized REST interface.

Unlike CRUD operations (handled by the REST API), abilities represent discrete actions like “pause this campaign” or “issue a refund.” Each ability validates permissions, executes the action via the service layer, and returns a structured response. Add-ons register their own abilities into the same categories — Ignition Platform Mode, for example, adds the campaign and update moderation abilities that core omits in direct mode.

All abilities are invoked via a single REST endpoint:

POST /wp-abilities/v1/abilities/{slug}/run

The request body contains the ability’s input parameters as JSON. Authentication uses the same cookie + nonce mechanism as the REST API (via wp.apiFetch).

Slug Label Description
igcf-campaigns Campaigns Abilities for managing crowdfunding campaigns.
igcf-updates Campaign Updates Category for campaign-update abilities. Core registers the category but ships no update abilities in direct mode — Ignition Platform Mode registers the approve / reject moderation abilities into it.
igcf-pledges Pledges Abilities for managing pledge status transitions.
igcf-payments Payments Abilities for managing payment gateways.

All campaign abilities accept a campaign_id input and return a response with status, statusLabel, and message.

Slug Label Permission
igcf/close-campaign Close Campaign edit_others_igcf_campaigns
igcf/feature-campaign Feature Campaign edit_others_igcf_campaigns
igcf/unfeature-campaign Unfeature Campaign edit_others_igcf_campaigns
igcf/pause-campaign Pause Campaign edit_others_igcf_campaigns or campaign author with edit_igcf_campaigns
igcf/resume-campaign Resume Campaign edit_others_igcf_campaigns or campaign author with edit_igcf_campaigns
igcf/end-campaign End Campaign edit_others_igcf_campaigns or campaign author with edit_igcf_campaigns
igcf/withdraw-campaign Withdraw Campaign edit_others_igcf_campaigns or campaign author with edit_igcf_campaigns
igcf/declare-campaign-result Declare Campaign Result edit_others_igcf_campaigns (admin only)
igcf/announce-goal-reached Announce Goal Reached edit_others_igcf_campaigns (admin only)

Input schema:

Field Type Required Description
campaign_id integer Yes The campaign to act on.

Output schema:

Field Type Description
status string The campaign’s new status slug after the action.
statusLabel string Human-readable status label.
message string Success message describing the action taken.

igcf/close-campaign closes an Ended campaign whether or not its result has been declared, and records which in the status history (Closed after the result was declared. or Closed without a recorded outcome.) — see Igcf_Campaign_Service::close(). If someone else changed the campaign’s status at the same moment, it returns igcf_campaign_status_conflict; retry.

Core registers no update abilities in direct mode. Campaign-update moderation (Approve Update, Reject Update, and the rejection-reason input) ships with the Ignition Platform Mode add-on, which registers them into the igcf-updates category. See the Platform Mode moderation guide.

Pledge abilities act on the three-record pledge model (see Service Layer). Recording an offline payment creates a succeeded Payment_Attempt, which cascades the pledge to succeeded; issuing a refund creates a Refund. They return status, statusLabel, and message (toggle-anonymous also returns is_anonymous).

Slug Label Permission
igcf/record-offline-payment Record Offline Payment igcf_manage_all_pledges (filter igcf_can_record_offline_payment)
igcf/cancel-pledge Cancel Pledge igcf_manage_all_pledges or the backer (pledge owner); filter igcf_can_cancel_pledge
igcf/issue-refund Issue Refund igcf_manage_all_pledges (filter igcf_can_issue_refund)
igcf/retry-payment-attempt Retry Payment Attempt igcf_manage_all_pledges (admin only)
igcf/mark-attempt-failed Mark Attempt Failed igcf_manage_all_pledges (admin only)
igcf/toggle-pledge-anonymous Toggle Pledge Anonymous igcf_manage_all_pledges or the backer (pledge owner)

Input schema (varies by ability):

Ability Required input Optional input
igcf/record-offline-payment pledge_id (integer) amount (integer ≥ 0, defaults to the pledge amount), note
igcf/cancel-pledge pledge_id (integer) cancel_reason (string), note
igcf/issue-refund payment_attempt_id (integer), amount (integer ≥ 1) reason (string), note
igcf/retry-payment-attempt pledge_id (integer) payment_method (string, defaults to offline), note
igcf/mark-attempt-failed payment_attempt_id (integer), failure_code (string) failure_message (string), note
igcf/toggle-pledge-anonymous pledge_id (integer) note

Output schema:

Field Type Description
status string The pledge’s resulting status slug.
statusLabel string Human-readable status label.
message string Success message describing the action.
is_anonymous boolean Only on igcf/toggle-pledge-anonymous — the new anonymous state.
Slug Label Permission
igcf/set-payment-gateway-enabled Set Payment Gateway Enabled manage_options (administrators only)

Drives the instant toggle on each payment method’s own settings screen, reached from the Payments admin tab. The service layer enforces the same guards regardless of caller — see Igcf_Payment_Gateway_Service::set_enabled() for the error contract.

Input schema:

Field Type Required Description
gateway_id string Yes The id of a gateway registered through igcf_register_payment_gateway().
enabled boolean Yes Target state.

Output schema:

Field Type Description
gateway_id string The gateway id that was toggled.
enabled boolean The new enabled state.
message string Success message.
status object The method’s badge after the write: key, label, tooltip. Lets a caller repaint the badge without a second request.
lock_reason string Why the toggle is now locked, or '' when it is free. Non-empty when the method has just become the only enabled one and can no longer be switched off.

Switching a payment method on or off is reserved for administrators, because a payment method is a connection to an outside service. Anyone without manage_options, operators included, gets igcf_rest_forbidden (403).

The ability returns one of these errors when a write is rejected: igcf_gateway_unknown (404), igcf_gateway_not_configured (400), igcf_gateway_last_enabled (409 — disabling would leave zero enabled gateways), or igcf_gateway_save_failed (500 — the save didn’t take, for example a database error or another plugin keeping the old value). The service also defines igcf_gateway_forbidden (403) for a caller the settings save guard holds back; through this ability the permission check refuses such a caller first.