-
Notifications
You must be signed in to change notification settings - Fork 1
Hooks Reference
Intercessor provides actions and filters for developers to extend its behavior without modifying core plugin files.
Fires before the scheduled prayer-count notification cron job processes requests.
do_action( 'intercessor_before_pray_notification_run' );Fires after the notification cron job completes. Receives the number of notifications sent.
do_action( 'intercessor_after_pray_notification_run', int $updated );Fires when a user confirms their email address via the confirmation link. Receives the WordPress user ID.
do_action( 'intercessor_email_confirmed', int $user_id );Example:
add_action( 'intercessor_email_confirmed', function( $user_id ) {
// Assign the user a specific role after confirmation
$user = get_userdata( $user_id );
if ( $user ) {
$user->set_role( 'prayer_warrior' );
}
} );Fires when rendering a custom settings field type. The {type} is the field's type value. Receives the field arguments array and the current value.
do_action( 'intercessor_settings_field_my_custom_type', array $args, mixed $value );Filter the array of available report views on the Reports page.
$views = apply_filters( 'intercessor_report_views', array $views );Example:
add_filter( 'intercessor_report_views', function( $views ) {
$views['my_custom_report'] = My_Custom_Report_View::class;
return $views;
} );Filter the tabs displayed on the requester detail page. Receives the tabs array and the requester object.
$tabs = apply_filters( 'intercessor_requester_tabs', array $tabs, object $requester );Filter the recipient email address for prayer-count notifications. Receives the email, the prayer request object, and the requester object.
$to = apply_filters( 'intercessor_pray_notification_to', string $to, object $request, object $requester );Filter the email subject line for prayer-count notifications.
$subject = apply_filters( 'intercessor_pray_notification_subject', string $subject, object $request, int $total_prayers );Filter the email body for prayer-count notifications.
$body = apply_filters( 'intercessor_pray_notification_body', string $body, object $request, object $requester, int $total_prayers );Example:
add_filter( 'intercessor_pray_notification_body', function( $body, $request, $requester, $total ) {
// Append a custom footer to notification emails
return $body . "\n\n— Sent with love from Our Church";
}, 10, 4 );Filter the arguments passed to wp_mail() for the email confirmation message sent during user registration.
$args = apply_filters( 'intercessor_confirmation_email_args', array $args );The $args array contains to, subject, message, and headers keys.