WC_Product_Usage_Rule_Set::get_rule()publicWC 1.0

Retrieve the value of a rule by name

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

Хуков нет.

Возвращает

Разное|null.

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

$WC_Product_Usage_Rule_Set = new WC_Product_Usage_Rule_Set();
$WC_Product_Usage_Rule_Set->get_rule( $rule_name );
$rule_name(строка) (обязательный)
name of the rule to retrieve value.

Код WC_Product_Usage_Rule_Set::get_rule() WC 9.4.2

public function get_rule( string $rule_name ) {
	if ( ! isset( $this->rules[ $rule_name ] ) ) {
		return null;
	}

	return $this->rules[ $rule_name ];
}