public static function get($key, $preferGlobal = false)
    {
        if (!self::$_initiated) {
            self::init();
        }

        if (!isset(self::$_config[$key])) {
            return null;
        }

        foreach (self::$modes as $mode) {
            if (isset(self::$modeSettings[$mode][$key])) {
                return self::$modeSettings[$mode][$key];
            }
        }

        if (!$preferGlobal && self::$_CurrentHTMLInstance && isset(self::$_CurrentHTMLInstance->$key)) {
            return self::$_CurrentHTMLInstance->$key;
        } else {
            if (class_exists('Xiphe\THEMASTER\core\THE')
                && class_exists(TM\THE::WPSETTINGS)
            ) {
                try {
                    return TM\THEWPSETTINGS::sGet_setting($key, XIPHE_HTML_TEXTID);
                } catch(\Exception $c) {
                    return self::$_config[$key];
                }
            }
            return self::$_config[$key];
        }
    }
public static function get($key, $preferGlobal = false)
    {
        if (!self::$_initiated) {
            self::init();
        }

        if (!isset(self::$_config[$key])) {
            return null;
        }

        foreach (self::$modes as $mode) {
            if (isset(self::$modeSettings[$mode][$key])) {
                return self::$modeSettings[$mode][$key];
            }
        }

        if (!$preferGlobal && self::$_CurrentHTMLInstance && isset(self::$_CurrentHTMLInstance->$key)) {
            return self::$_CurrentHTMLInstance->$key;
        } else {
            if (class_exists('Xiphe\THEMASTER\core\THE')
                && class_exists(TM\THE::WPSETTINGS)
            ) {
                try {
                    return TM\THEWPSETTINGS::sGet_setting($key, XIPHE_HTML_TEXTID);
                } catch(\Exception $c) {
                    return self::$_config[$key];
                }
            }
            return self::$_config[$key];
        }
    }
public static function get ( $ key , $ preferGlobal = false ) { if ( ! self :: $ _initiated ) { self :: init ( ) ; } if ( ! isset ( self :: $ _config [ $ key ] ) ) { return null ; } foreach ( self :: $ modes as $ mode ) { if ( isset ( self :: $ modeSettings [ $ mode ] [ $ key ] ) ) { return self :: $ modeSettings [ $ mode ] [ $ key ] ; } } if ( ! $ preferGlobal && self :: $ _CurrentHTMLInstance && isset ( self :: $ _CurrentHTMLInstance -> $ key ) ) { return self :: $ _CurrentHTMLInstance -> $ key ; } else { if ( class_exists ( 'Xiphe\THEMASTER\core\THE' ) && class_exists ( TM \ THE :: WPSETTINGS ) ) { try { return TM \ THEWPSETTINGS :: sGet_setting ( $ key , XIPHE_HTML_TEXTID ) ; } catch ( \ Exception $ c ) { return self :: $ _config [ $ key ] ; } } return self :: $ _config [ $ key ] ; } }
Getter for the current value for the requested key.

Setting hierarchy:
- Ajax setting (if Mode is on)
- Instance setting
- THEWPSETTING (if Xiphe\THEMASTER\core\THEWPSETTINGS exists)
- config.php setting (if exists)
- default.

If the requested key is not existent on one layer the next one
will be used.

@param string  $key          The name of the setting.
@param boolean $preferGlobal Eliminates the instance setting from hierarchy.

@return mixed The setting value.
Getter for the current value for the requested key .