Tribe__Autoloader::register_prefix( string $prefix, string $root_dir, string $slug = '' )

Associates a class prefix to an absolute path.


Parameters

$prefix

(string) (Required) A class prefix, e.g. Tribe__Admin__

$root_dir

(string) (Required) The absolute path to the dir containing the prefixed classes.

$slug

(string) (Optional) An optional unique slug to associate to the prefix.

Default value: ''


Top ↑

Source

File: src/Tribe/Autoloader.php

			public function register_prefix( $prefix, $root_dir, $slug = '' ) {
				$root_dir = $this->normalize_root_dir( $root_dir );

				if ( ! isset( $this->prefixes[ $prefix ] ) ) {
					$this->prefixes[ $prefix ] = array();
				}
				$this->prefixes[ $prefix ][] = $root_dir;

				if ( $slug ) {
					$this->prefix_slugs[ $slug ] = $prefix;
				}
			}