Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /home/claqxcrl/giraluanda.com/wp-content/plugins/the-events-calendar/src/Tribe/Editor/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/claqxcrl/giraluanda.com/wp-content/plugins/the-events-calendar/src/Tribe/Editor/Settings.php
<?php
/**
 * Fetch the Tribe Settings to use on the JS side
 *
 * @since 4.7
 */
class Tribe__Events__Editor__Settings {
	/**
	 * Hook into the required places to make it work
	 *
	 * @since 4.7
	 *
	 * @return void
	 */
	public function hook() {

	}

	/**
	 * Based on a set of rules determines if a Tribe Option is private or not
	 *
	 * @since 4.7
	 *
	 * @param string $key Which key we are checking against
	 *
	 * @return boolean
	 */
	public function is_private_option( $key ) {
		$unsafe_rules = [
			'_token',
			'_key',
		];

		foreach ( $unsafe_rules as $rule ) {
			if ( preg_match( '/' . $rule . '/', $key ) ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Get all Public options of Tribe Options
	 *
	 * @since 4.7
	 *
	 * @todo   move the filtering into Core Tribe__Settings_Manager::get_options
	 *
	 * @return array
	 */
	public function get_options() {
		$raw_options = Tribe__Settings_Manager::get_options();
		$options = [];

		foreach ( $raw_options as $key => $option ) {
			if ( $this->is_private_option( $key ) ) {
				continue;
			}

			$options[ $key ] = tribe_get_option( $key );
		}

		return $options;
	}
}

ZeroDay Forums Mini