Automattic\WooCommerce\Gateways\PayPal

Buttons::get_current_page_for_app_switchpublicWC 10.5.0

Get the current page URL, to be used for App Switch. Limited to checkout, cart, and product pages for security.

Метод класса: Buttons{}

Хуков нет.

Возвращает

Строку.

Использование

$Buttons = new Buttons();
$Buttons->get_current_page_for_app_switch(): string;

Список изменений

С версии 10.5.0 Введена.

Код Buttons::get_current_page_for_app_switch() WC 10.9.4

public function get_current_page_for_app_switch(): string {
	// If checkout, cart or product page, return the current page URL.
	if ( wc_get_container()->get( LegacyProxy::class )->call_function( 'is_checkout' ) || is_cart() || is_product() ) {
		return get_permalink( get_the_ID() );
	}

	return '';
}