HEX
Server: Apache
System: Linux webm019.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: marieroufy (41973)
PHP: 7.2.34
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/marieroufy/www/wp-content/plugins/mesmerize-companion/src/Customizer/Settings/AutoSetting.php
<?php

namespace Mesmerize\Customizer\Settings;

class AutoSetting extends \Mesmerize\Customizer\BaseSetting
{
    
    const TYPE = 'cp_auto_setting';
    const SETTING_PATTERN = '/CP_AUTO_SETTING\[(.*)\]/s';
    
    public function init()
    {
        $this->type = self::TYPE;
        $this->transport = 'postMessage';
    }
    
    public function getRealMod()
    {
        $matches = array();
        
        if (preg_match(AutoSetting::SETTING_PATTERN, $this->id, $matches)) {
            $mod = $matches[1];
            
            return $mod;
        }
        
        return '';
    }
    
    public function update($value)
    {
        $mod      = $this->getRealMod();
        $mod      = trim($mod);
        $this->id = $mod;
        $this->type = 'theme_mod';
        return parent::update($value);
    }
    
    
    public function value()
    {
        // $undefined  = new stdClass();
        if ($this->is_previewed) {
            $value = $this->post_value();
        } else {
            $mod   = $this->getRealMod();
            $value = get_theme_mod($mod, false);
        }
        
        return $value;
    }
}