File "Error.php"
Full path: C:/Inetpub/vhosts/drshti.com/httpdocs/wp-content/plugins/depicter/modules/jeffreyvanrossum/Error.php
File
size: 796 B (796 B bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor &nnbsp; Back
<?php
namespace Depicter\Jeffreyvr\WPSettings;
class Error
{
public $settings;
public $errors;
public function __construct($settings)
{
$this->errors = new \WP_Error;
$this->settings = $settings;
}
public function get_all()
{
global $wp_settings_error;
return $wp_settings_error[$this->settings->option_name] ?? false;
}
public function get($key)
{
$errors = $this->get_all();
if (!is_wp_error($errors)) {
return;
}
return $errors->get_error_message($key);
}
public function add($key, $message)
{
global $wp_settings_error;
$this->errors->add($key, $message);
$wp_settings_error[$this->settings->option_name] = $this->errors;
}
}