WC_Object_Query::get( string $query_var, mixed $default = '' )

Get the value of a query variable.


Description Description


Parameters Parameters

$query_var

(Required) Query variable to get value for.

$default

(Optional) Default value if query variable is not set.

Default value: ''


Top ↑

Return Return

(mixed) Query variable value if set, otherwise default.


Top ↑

Source Source

File: includes/abstracts/abstract-wc-object-query.php

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

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.