Error thrown

Call to undefined method WP_Error::is_error()