Automattic\WooCommerce\Internal\ProductAttributes

VisualAttributeTermAdmin::is_ajax_add_attribute_requestprivateWC 1.0

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

Method of the class: VisualAttributeTermAdmin{}

No Hooks.

Returns

true|false.

Usage

// private - for code of main (parent) class only
$result = $this->is_ajax_add_attribute_request(): bool;

VisualAttributeTermAdmin::is_ajax_add_attribute_request() code WC 10.9.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;
}