Error thrown

Call to undefined method WP_Error::get_id()