Added $post_id extra definition for wp-admin variation preview mode. Debug mode was throwing "invalid index post_id" errors.