HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/somonline.org/wp-content/themes/zeen/inc/classes/class-zeen-options.php
<?php
/**
 * Zeen options
 *
 * @package     Zeen
 * @copyright   Copyright Codetipi
 * @since       1.0.0
 */
class ZeenOptions {

	/**
	 * Options
	 *
	 * @since    1.0.0
	 */
	static $zeen_options;

	/**
	 * Options getter
	 *
	 * @since    1.0.0
	 */
	static function zeen_get_option( $option = 'zeen_engine_options' ) {

		self::$zeen_options = get_option( $option, array() );

	}

	/**
	 * Options setter
	 *
	 * @since    1.0.0
	 */
	static function zeen_update_option( $option = 'zeen_engine_options' ) {

		$options = self::zeen_sanitized();
		update_option( $option, $options );
		self::$zeen_options = get_option( 'zeen_engine_options' );

	}

	/**
	 * Options sanitizer
	 *
	 * @since    1.0.0
	 */
	private static function zeen_sanitized( $option = '' ) {

		$option = empty( $option ) ? self::$zeen_options : $option;
		$sanitized_array = array();
		if ( ! is_array( $option ) ) {
			return array();
		}

		foreach ( $option as $key => $value ) {

			if ( ! is_array( $value ) && ! is_object( $value ) ) {
				$sanitized_array[ esc_html( $key ) ] = esc_attr( $value );
			}

			if ( is_array( $value ) ) {
				$sanitized_array[ esc_html( $key ) ] = self::zeen_sanitized( $value );
			}
		}

		return $sanitized_array;
	}

	/**
	 * Spon Posts
	 *
	 * @since    1.0.0
	 */
	static function zeen_get_spon() {

		$output = empty( self::$zeen_options['zeen_spon'] ) ? '' : self::$zeen_options['zeen_spon'];

		return $output;

	}

	/**
	 * Sidebar Post IDs
	 *
	 * @since    1.0.0
	 */
	static function zeen_get_sidebar_pids() {

		$output = empty( self::$zeen_options['zeen_sidebar_pids'] ) ? '' : self::$zeen_options['zeen_sidebar_pids'];

		return $output;

	}

	/**
	 * Builder IDs
	 *
	 * @since    1.0.0
	 */
	static function zeen_get_sidebar_bids() {

		$output = empty( self::$zeen_options['zeen_sidebar_bids'] ) ? '' : self::$zeen_options['zeen_sidebar_bids'];

		return $output;

	}

	/**
	 * Sidebar Term IDs
	 *
	 * @since    1.0.0
	 */
	static function zeen_get_sidebar_tids() {

		$output = empty( self::$zeen_options['zeen_sidebar_tids'] ) ? '' : self::$zeen_options['zeen_sidebar_tids'];

		return $output;

	}
	/**
	 * Sidebar Custom IDs
	 *
	 * @since    4.0.0
	 */
	static function zeen_get_sidebar_cids() {

		$output = empty( self::$zeen_options['zeen_sidebar_cids'] ) ? '' : self::$zeen_options['zeen_sidebar_cids'];

		return $output;

	}

}

ZeenOptions::zeen_get_option();