Skip to main content

benecaster_sponsor_manager_after_archive_sponsor

Action Premium sponsor-manager

Fires once a sponsor has been archived or restored on the Sponsors screen, or through POST /benecaster-sponsor-manager/v1/sponsors/{id}/archive or …/restore. It fires only when the write succeeded.

Parameters

Name Type Default Description
$sponsor_id int — The sponsor
$archived bool — `true` when it was archived, `false` when restored

Example

add_action( 'benecaster_sponsor_manager_after_archive_sponsor', function ( int $sponsor_id, bool $archived ): void {
    my_crm_set_company_active( $sponsor_id, ! $archived );
}, 10, 2 );

Notes

Asking for the state the sponsor already has writes nothing and fires nothing. Walkthrough: Read, create, change, archive or restore the site's sponsors and a show's sponsor campaigns from code, as the Sponsors screen does.

Affects

  • Benecaster → Sponsors
  • POST benecaster-sponsor-manager/v1/sponsors/{id}/archive
  • POST benecaster-sponsor-manager/v1/sponsors/{id}/restore

Need this built rather than just documented? See our services →