Tribe__Customizer::has_option()

Check if the option exists, this method is used allow only sections that were saved to be applied.


Parameters

(strings) (Required) Using the following structure: self::has_option( 'section_name', 'setting_name' );


Top ↑

Return

(boolean) Whether the option exists in the database


Top ↑

Source

File: src/Tribe/Customizer.php

	public function has_option() {
		$search = func_get_args();
		$option = self::get_option();
		$real_option = get_option( $this->ID, array() );

		// Get section and Settign based on keys
		$section = reset( $search );
		$setting = end( $search );

		if ( empty( $real_option ) || empty( $real_option[ $section ] ) ) {
			return false;
		}

		// Search on the Array
		if ( ! is_null( $search ) ) {
			$option = self::search_var( $option, $search, null );
		}

		return ! empty( $option );
	}