Tribe__Context::filter( array $filters, mixed $default )

Reads (gets) the value applying one or more filters.


Parameters

$filters

(array) (Required) The list of filters to apply, in order.

$default

(mixed) (Required) The default value to return.


Top ↑

Return

(mixed) The first valid value found or the default value.


Top ↑

Source

File: src/Tribe/Context.php

	public function filter( array $filters, $default ) {
		foreach ( $filters as $filter ) {
			$the_value = apply_filters( $filter, $default );
			if ( $the_value !== $default ) {
				return $the_value;
			}
		}

		return $default;
	}

Top ↑

Changelog

Changelog
Version Description
4.9.8 Introduced.