DOCS

Campaign Expiration

Fundations can automatically close or hide fundraising pages when they pass their end date. This feature is disabled by default and must be enabled in settings. It is available in the free plugin.

Why use it

Fundraisers set end dates when creating their pages. Without expiration enabled, those dates are informational only. The page stays live indefinitely. Enabling expiration lets you automatically retire ended campaigns, notify creators, and keep your site showing only active fundraising pages.

What it does

A daily background task (WordPress cron) checks for published campaigns whose end date has passed. For each expired campaign:

  1. The campaign is marked as expired in the database.
  2. Depending on the visibility setting, the campaign is either set to draft (hidden from visitors) or left published (visible but marked expired).
  3. An email notification is sent: to the registered creator if the campaign has one, or to the site admin if the campaign was created by a guest and never claimed.

The cron processes up to 100 campaigns per run. If you have more than 100 campaigns expiring on the same day, the remainder will be processed on the next daily run.

Expiration settings

How to use it

Enabling expiration

  1. Go to Fundations > Settings.
  2. Find the Expiration section.
  3. Enable the Auto-expiration toggle.
  4. Configure visibility, grace period, and email options.
  5. Save settings.

Expiration will begin running at the next scheduled WordPress cron cycle (once daily).

Configuring visibility

When a campaign expires you can choose what happens to it. With the default setting of “Hide”, the campaign post is set to draft and is no longer visible to visitors, though the fundraiser can still see it in their dashboard. With “Show”, the campaign remains published and is still accessible at its URL, but it carries an expired flag that themes and blocks can use to display an “ended” notice.

The global visibility setting applies to all campaigns. Individual campaigns can override this setting if Allow creators to choose expiration visibility is enabled (see per-campaign overrides below).

When you switch the global visibility from hide to show, all previously hidden expired campaigns are immediately republished (unless they have a per-campaign override of hide). When you switch from show to hide, all published expired campaigns are immediately set to draft (unless they have a per-campaign override of show).

Setting a grace period

The grace period delays expiration by a number of days after the end date. For example, a grace period of 2 means a campaign with an end date of June 10 will not expire until June 12.

Default grace period: 0 days (expires immediately after the end date).

Per-campaign visibility overrides

If you enable Allow creators to choose expiration visibility in settings, fundraisers will see a visibility option in the frontend edit form for their expired campaign. They can choose from three options: use the global setting (default), keep the campaign published after expiry regardless of the global setting, or set the campaign to draft after expiry regardless of the global setting.

Administrators can always set this override from the WordPress admin, regardless of whether the setting is enabled for creators.

Manual trigger

If you need to run the expiration check immediately without waiting for the next cron run:

  1. Go to Plugins in the WordPress admin.
  2. Find the Fundations plugin row.
  3. Click Check Expired (only visible when auto-expiration is enabled).

You will be redirected to Fundations > Settings > Wizard with a notice showing how many campaigns were expired.

Reactivating an expired campaign

When a campaign expires, fundraisers can reactivate it by setting a new end date in the future:

  1. The fundraiser goes to the frontend edit form for their campaign.
  2. They set a new end date that is after today.
  3. They save the form.

The campaign is automatically republished, the expired flag is removed, and the get_fund_action_reactivated action fires.

This option can be disabled by setting get_fund_expiration_creator_can_extend to false in settings.

Settings & options

OptionDefaultDescription
get_fund_expiration_enabledfalseEnable the automatic expiration feature
get_fund_expiration_grace_days0Number of days after end date before expiration is applied
get_fund_expiration_visibilityhideWhat happens to expired campaigns: show (stay published) or hide (set to draft)
get_fund_expiration_creator_can_extendtrueAllow fundraisers to reactivate expired campaigns by setting a new end date
get_fund_expiration_creator_can_choosefalseAllow fundraisers to set a per-campaign expiration visibility override
get_fund_expiration_user_email_enabledtrueSend expiration email to the campaign creator
get_fund_expiration_admin_email_enabledtrueSend expiration email to the admin for unclaimed/guest campaigns

What you can and cannot do

You can set a grace period to give campaigns a few extra days before expiry, allow fundraisers to reactivate their own expired campaigns, override the global visibility setting per campaign, manually trigger the expiration check from the Plugins page, and prevent specific campaigns from ever expiring using the get_fund_should_expire_action filter.

You cannot run the cron check more frequently than once per day without a custom cron schedule, process more than 100 campaigns in a single cron run, or automatically reactivate campaigns (reactivation always requires the fundraiser to set a new date).

Troubleshooting

ProblemLikely causeFix
Campaigns are not expiringAuto-expiration is disabledEnable it in Fundations > Settings > Expiration
Campaigns are not expiring despite expiration being enabledWordPress cron is not runningInstall a real cron plugin or configure server-side cron for wp-cron.php
Expired campaigns are still visibleGlobal visibility is set to showChange the visibility to hide in settings
Expired campaigns disappeared but should be visibleGlobal visibility is set to hideChange to show, or use a per-campaign override
Creator is not receiving expiration emailsOption is disabled or the campaign has no registered creatorCheck email settings; guest campaigns go to the admin, not the creator
Reactivation option does not appear in the edit formget_fund_expiration_creator_can_extend is disabledEnable the option in settings

Developer reference

Hooks and filters

HookTypeDescription
get_fund_should_expire_actionfilterReturn false to prevent a specific campaign from expiring; receives bool $should_expire, int $action_id
get_fund_expiration_email_placeholdersfilterModify placeholder values in expiration emails; receives array $placeholders, int $action_id, string $type
get_fund_before_expirationactionFires before a campaign is expired; receives int $action_id
get_fund_action_expiredactionFires after a campaign is expired; receives int $action_id, int $creator_id (0 for unclaimed)
get_fund_action_reactivatedactionFires after a campaign is reactivated; receives int $action_id, string $new_end_date

Signatures

// Prevent a VIP campaign from ever expiring
add_filter( 'get_fund_should_expire_action', function( bool $should_expire, int $action_id ) {
    if ( get_post_meta( $action_id, '_my_vip_campaign', true ) ) {
        return false;
    }
    return $should_expire;
}, 10, 2 );

// Send a Slack notification when a campaign is expired
add_action( 'get_fund_action_expired', function( int $action_id, int $creator_id ) {
    $title = get_the_title( $action_id );
    // send_slack_notification( "Campaign expired: {$title}" );
}, 10, 2 );

// Add a custom field value to expiration emails
add_filter( 'get_fund_expiration_email_placeholders', function( array $placeholders, int $action_id, string $type ) {
    $placeholders['{team_name}'] = get_post_meta( $action_id, '_my_team_name', true );
    return $placeholders;
}, 10, 3 );