WC_Object_Query::get()publicWC 1.0

Get the value of a query variable.

{} It's a method of the class: WC_Object_Query{}

No Hooks.

Return

Mixed. Query variable value if set, otherwise default.

Usage

$WC_Object_Query = new WC_Object_Query();
$WC_Object_Query->get( $query_var, $default );
$query_var(string) (required)
Query variable to get value for.
$default(mixed)
Default value if query variable is not set.
Default: ''

Code of WC_Object_Query::get() WC 6.8.2

public function get( $query_var, $default = '' ) {
	if ( isset( $this->query_vars[ $query_var ] ) ) {
		return $this->query_vars[ $query_var ];
	}
	return $default;
}