PATH:
home
/
fengshp
/
www
/
wp-content
/
plugins
/
wp-events-manager
/
inc
<?php /** * WP Events Manager Settings class * * @author ThimPress, leehld * @package WP-Events-Manager/Class * @version 2.1.7 */ /** * Prevent loading this file directly */ defined( 'ABSPATH' ) || exit; class WPEMS_Settings { /** * $_options * @var null */ public $_options = null; /** * prefix option name * @var string */ public $_prefix = 'thimpress_events'; /** * _instance * @var null */ static $_instance = null; public function __construct( $prefix = null ) { if ( $prefix ) { $this->_prefix = $prefix; } // load options if ( ! $this->_options ) { $this->_options = $this->options(); } } public function __get( $id = null ) { $settings = apply_filters( 'tp_event_settings_field', array() ); if ( isset( $settings[ $id ] ) ) { return $settings[ $id ]; } } /** * options load options * @return array || null */ protected function options() { $options = get_option( $this->_prefix, [] ); return $options; } /** * get_name_field * * @param $name of field option * * @return string name field */ public function get_field_name( $name = null ) { if ( ! $this->_prefix || ! $name ) { return; } return $this->_prefix . '[' . $name . ']'; } /** * get_name_field * * @param $name of field option * * @return string name field */ public function get_field_id( $name = null, $default = null ) { if ( ! $this->_prefix || ! $name ) { return; } return $this->_prefix . '_' . $name; } /** * get option value * * @param $name * * @return option value. array, string, boolean */ public function get( $name = null, $default = null ) { if ( ! $this->_options ) { $this->_options = $this->options(); } if ( $name && isset( $this->_options[ $name ] ) ) { return $this->_options[ $name ]; } return $default; } /** * get option value * * @param $name * * @return option value. array, string, boolean */ public function set( $name = null, $default = null ) { if ( ! $this->_options ) { $this->_options = $this->options(); } if ( $name && isset( $this->_options[ $name ] ) ) { return $this->_options[ $name ]; } return $default; } /** * instance * * @param $prefix * * @return object class */ public static function instance( $prefix = null ) { if ( ! empty( self::$_instance[ $prefix ] ) ) { return $GLOBALS['event_auth_settings'] = self::$_instance[ $prefix ]; } return $GLOBALS['event_auth_settings'] = self::$_instance[ $prefix ] = new self( $prefix ); } }
[+]
..
[-] class-wpems-event.php
[edit]
[-] class-wpems-gdpr.php
[edit]
[-] class-wpems-payment-gateways.php
[edit]
[+]
admin
[-] class-wpems-frontend-assets.php
[edit]
[-] class-wpems-shortcodes.php
[edit]
[+]
widgets
[+]
emails
[-] class-wpems-template.php
[edit]
[-] class-wpems-session.php
[edit]
[-] class-wpems-settings.php
[edit]
[+]
gateways
[-] class-wpems-install.php
[edit]
[-] class-wpems-assets.php
[edit]
[-] class-wpems-booking.php
[edit]
[+]
libraries
[-] class-wpems-autoloader.php
[edit]
[-] wpems-core-functions.php
[edit]
[-] class-wpems-user-process.php
[edit]
[-] class-wpems-ajax.php
[edit]
[+]
abstracts
[-] class-wpems-post-types.php
[edit]