public function fromWp(\WP_Error $WP_Error): CoreClasses\Core\Error
    {
        $Error = $this->c::error();

        foreach ($WP_Error->errors as $_code => $_messages) {
            $_slug = $this->c::nameToSlug($_code);
            $_data = $WP_Error->error_data[$_code] ?? null;

            foreach ($_messages as $_message) {
                $Error->add($_slug, $_message, $_data);
            } // unset($_message); // Housekeeping.
        } // unset($_code, $_messages, $_slug, $_data); // Housekeeping.

        return $Error;
    }
public function fromWp(\WP_Error $WP_Error): CoreClasses\Core\Error
    {
        $Error = $this->c::error();

        foreach ($WP_Error->errors as $_code => $_messages) {
            $_slug = $this->c::nameToSlug($_code);
            $_data = $WP_Error->error_data[$_code] ?? null;

            foreach ($_messages as $_message) {
                $Error->add($_slug, $_message, $_data);
            } // unset($_message); // Housekeeping.
        } // unset($_code, $_messages, $_slug, $_data); // Housekeeping.

        return $Error;
    }
public function fromWp ( \ WP_Error $ WP_Error ) : CoreClasses \ Core \ Error { $ Error = $ this -> c :: error ( ) ; foreach ( $ WP_Error -> errors as $ _code => $ _messages ) { $ _slug = $ this -> c :: nameToSlug ( $ _code ) ; $ _data = $ WP_Error -> error_data [ $ _code ] ?? null ; foreach ( $ _messages as $ _message ) { $ Error -> add ( $ _slug , $ _message , $ _data ) ; } // unset($_message); // Housekeeping. } // unset($_code, $_messages, $_slug, $_data); // Housekeeping. return $ Error ; }
Converts a WP_Error.

@since 160710 App utils.

@param \WP_Error $WP_Error Error object.

@return CoreClasses\Core\Error Based on WP_Error
Converts a WP_Error .