Automattic\WooCommerce\Gateways\PayPal
Buttons::get_page_type
Get the page type for the PayPal buttons.
Метод класса: Buttons{}
Хуков нет.
Возвращает
string.
Использование
$Buttons = new Buttons(); $Buttons->get_page_type(): string;
Список изменений
| С версии 10.5.0 | Введена. |
Код Buttons::get_page_type() Buttons::get page type WC 11.2.2
public function get_page_type(): string {
$page_type = 'checkout';
if ( is_cart() || has_block( 'woocommerce/cart' ) ) {
$page_type = 'cart';
} elseif ( is_product() ) {
$page_type = 'product-details';
}
return $page_type;
}