Tribe__Assets_Pipeline::prevent_select2_conflict( string $tag, string $handle )

After select2 is loaded to the FE we add one scripts after to prevent select2 from breaking.


Parameters #

$tag

(string) (Required) The <script> tag for the enqueued script.

$handle

(string) (Required) The script's registered handle.


Top ↑

Return #

(string) The <script> tag.


Top ↑

Source #

File: src/Tribe/Assets_Pipeline.php

	public function prevent_select2_conflict( $tag, $handle ) {
		if ( 'tribe-select2' !== $handle ) {
			return $tag;
		}

		$dir = Tribe__Main::instance()->plugin_url . 'src/resources/js';
		$tag .= "<script src='{$dir}/select2-after.js'></script>\n";

		return $tag;
	}

Top ↑

Changelog #

Changelog
Version Description
4.14.18 Ensure we don't run this in the admin.
4.13.2 Introduced.