Automattic\WooCommerce\Gateways\PayPal

Notices::add_paypal_notices_on_payments_settings_pagepublicWC 10.5.0

Add PayPal notices on the payments settings page.

Method of the class: Notices{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Notices = new Notices();
$Notices->add_paypal_notices_on_payments_settings_page(): void;

Changelog

Since 10.5.0 Introduced.

Notices::add_paypal_notices_on_payments_settings_page() code WC 10.7.0

public function add_paypal_notices_on_payments_settings_page(): void {
	global $current_tab, $current_section;

	$screen    = get_current_screen();
	$screen_id = $screen ? $screen->id : '';

	$is_payments_settings_page = 'woocommerce_page_wc-settings' === $screen_id && 'checkout' === $current_tab && empty( $current_section );

	// Only add the notice from this callback on the payments settings page.
	if ( ! $is_payments_settings_page ) {
		return;
	}

	$this->add_paypal_notices();
}