Hooks::filter_de_prioritize_module( string $default_module, string[] $available_modules )

If other modules are active, we should de prioritize this one (we want other commerce modules to take priority over this one).


Parameters

$default_module

(string) (Required)

$available_modules

(string[]) (Required)


Top ↑

Return

(string)


Top ↑

Source

File: src/Tickets/Commerce/Hooks.php

	public function filter_de_prioritize_module( $default_module, array $available_modules ) {
		$tribe_commerce_module = get_class( $this );

		// If this isn't the default (or if there isn't a choice), no need to de prioritize.
		if (
			$default_module !== $tribe_commerce_module
			|| count( $available_modules ) < 2
			|| reset( $available_modules ) !== $tribe_commerce_module
		) {
			return $default_module;
		}

		return next( $available_modules );
	}

Top ↑

Changelog

Changelog
Version Description
5.1.9 Introduced.