WC_Admin_Settings::add_error PHP Method

add_error() public static method

Add an error.
public static add_error ( string $text )
$text string
        public static function add_error($text)
        {
            self::$errors[] = $text;
        }

Usage Example

 /**
  * Check authentication of access credentials
  */
 public function gf_auth_check()
 {
     $auth = $GLOBALS['wc_graphflow']->get_api()->test_auth();
     if ($auth) {
         $notice_text = "Your Graphflow access keys have been verified!";
         WC_Admin_Settings::add_message($notice_text);
     } else {
         $notice_text = "Your Graphflow access keys failed verification. Please check your Graphflow Account Page to retrieve the correct keys.";
         WC_Admin_Settings::add_error($notice_text);
     }
 }
All Usage Examples Of WC_Admin_Settings::add_error