| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/WPCAFE/wp-content/plugins/wp-cafe/base/ |
Upload File : |
<?php
namespace WpCafe;
/**
* Settings class
*/
class Settings {
/**
* Store option name
*
* @var string
*/
protected static $option_name = 'wpcafe_reservation_settings_options';
/**
* Get settings
*
* @param string $key
*
* @return mixed
*/
public static function get( $key = '' ) {
$settings = get_option( self::$option_name, [] );
if ( ! $key ) {
return $settings;
}
$value = '';
if ( ! empty( $settings[$key] ) ) {
$value = $settings[$key];
}
return $value;
}
/**
* Update settings
*
* @param array $options
*
* @return void
*/
public static function update( $options = [] ) {
$settings = self::get();
foreach ( $options as $name => $value ) {
$settings[$name] = $options[$name];
}
return update_option( self::$option_name, $settings );
}
}