Automattic\WooCommerce\Internal\ProductAttributes

VisualAttributeTermAdmin::is_ajax_add_attribute_requestprivateWC 1.0

Check whether the current request is the add attribute AJAX action.

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

Хуков нет.

Возвращает

true|false.

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

// private - только в коде основоного (родительского) класса
$result = $this->is_ajax_add_attribute_request(): bool;

Код VisualAttributeTermAdmin::is_ajax_add_attribute_request() WC 11.0.1

private function is_ajax_add_attribute_request(): bool {
	$action = isset( $_REQUEST['action'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended

	return wp_doing_ajax() && 'woocommerce_add_new_attribute' === $action;
}