Tribe__Customizer__Section::get_section_slug( string $class_name )

Get the section slug based on the Class name.


Parameters

$class_name

(string) (Required) The name of this Class.


Top ↑

Return

(string) $slug The slug for this Class.


Top ↑

Source

File: src/Tribe/Customizer/Section.php

	final public static function get_section_slug( $class_name ) {
		$abstract_name = __CLASS__;
		$reflection = new ReflectionClass( $class_name );

		// Get the Slug without the Base name
		$slug = str_replace( $abstract_name . '_', '', $reflection->getName() );

		if ( false !== strpos( $slug, '__Customizer__' ) ) {
			$slug = explode( '__Customizer__', $slug );
			$slug = end( $slug );
		}

		return strtolower( $slug );
	}