|
/ Documentation /Developer Hooks & Events/ suredonation_show_review_notice_gateway Filter Hook

suredonation_show_review_notice_gateway Filter Hook

Overview

The suredonation_show_review_notice_gateway filter controls whether the Leave a Review admin notice is displayed when a payment gateway has been configured but the site has not received any live donations yet.

By default, the notice is enabled. Developers can use this filter to suppress the notice when it is not appropriate for a specific website or admin workflow.

When to Use This Filter

Use this filter when you need to control the visibility of the gateway review notice.

For example, you can use it to:

  • Hide the review notice.
  • Suppress review requests for specific websites.
  • Disable the notice for custom admin workflows.
  • Control the notice based on custom conditions.

Filter Signature

apply_filters( 'suredonation_show_review_notice_gateway', true );

Parameters

ParameterTypeDescription
$valueboolDetermines whether the gateway review notice should be displayed.

Default Value

The default value is: true

This means the review notice is enabled by default.

Return Value

Return a boolean value:

Return ValueResult
trueAllows the review notice to be displayed.
falseSuppresses the review notice.

Basic Usage

Use add_filter() to register a custom callback.

add_filter('suredonation_show_review_notice_gateway', 'your_custom_function', 10, 1 );

function your_custom_function( $show ) {

    return $show;

}

Example: Disable the Review Notice

The following example permanently disables the gateway review notice.

// Never show the gateway review notice.

add_filter( 'suredonation_show_review_notice_gateway',  '__return_false');

Example: Conditionally Disable the Notice

You can also use custom conditions to determine whether the notice should be displayed.

add_filter( 'suredonation_show_review_notice_gateway', 'mysite_hide_gateway_review_notice', 10, 1);

function mysite_hide_gateway_review_notice( $show ) {

    if ( current_user_can( 'manage_options' ) ) {
        return false;
    }
    return $show;
}

How It Works

The filter is applied inside:

Notices::display_review_notice_gateway()

The filter determines whether SureDonation is allowed to display the review notice.

Returning false prevents the notice from being displayed.

Additional Display Conditions

Returning true does not force the notice to appear. SureDonation also checks additional conditions before displaying it.

The gateway review notice is displayed only when:

  • At least three days have elapsed.
  • No live donation has been received yet.
  • A payment gateway has been configured.
  • The filter allows the notice to be displayed.

Related Hooks

  • suredonation_show_review_notice_donation
  • suredonation_show_setup_gateway_notice
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top