fixing fatal error where $editor was a WP_Error