WC_Product_Usage_Rule_Set::get_rule()publicWC 1.0

Retrieve the value of a rule by name

Method of the class: WC_Product_Usage_Rule_Set{}

No Hooks.

Return

Mixed|null.

Usage

$WC_Product_Usage_Rule_Set = new WC_Product_Usage_Rule_Set();
$WC_Product_Usage_Rule_Set->get_rule( $rule_name );
$rule_name(string) (required)
name of the rule to retrieve value.

WC_Product_Usage_Rule_Set::get_rule() code WC 9.4.2

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

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