ACF_Admin_Email_Opt_In_Banner::should_showpublicACF 6.8.6

Determines if the banner should be shown for the current request.

Method of the class: ACF_Admin_Email_Opt_In_Banner{}

Hooks from the method

Returns

true|false.

Usage

$ACF_Admin_Email_Opt_In_Banner = new ACF_Admin_Email_Opt_In_Banner();
$ACF_Admin_Email_Opt_In_Banner->should_show();

Changelog

Since 6.8.6 Introduced.

ACF_Admin_Email_Opt_In_Banner::should_show() code ACF 6.8.8

public function should_show() {
	if ( ! acf_get_setting( 'show_admin' ) ) {
		return false;
	}

	if ( ! current_user_can( acf_get_setting( 'capability' ) ) ) {
		return false;
	}

	if ( ! $this->is_supported_screen() ) {
		return false;
	}

	$default = ! $this->is_state_persisted();

	/**
	 * Filters whether the ACF Free email opt-in banner should be shown.
	 *
	 * @since 6.8.6
	 *
	 * @param boolean $show Whether to show the banner.
	 */
	return (bool) apply_filters( 'acf/admin/show_email_opt_in_banner', $default );
}