WP_REST_Server::get_json_last_error PHP Method

get_json_last_error() protected method

Strings to be translated will be in format like "Encoding error: Maximum stack depth exceeded".
Since: 4.4.0
protected get_json_last_error ( ) : boolean | string
return boolean | string Boolean false or string error message.
    protected function get_json_last_error()
    {
        // See https://core.trac.wordpress.org/ticket/27799.
        if (!function_exists('json_last_error')) {
            return false;
        }
        $last_error_code = json_last_error();
        if (defined('JSON_ERROR_NONE') && JSON_ERROR_NONE === $last_error_code || empty($last_error_code)) {
            return false;
        }
        return json_last_error_msg();
    }