这个问题通常出现在BuddyPress相册插件的最新版本。可以通过以下方式解决:
$query = $wpdb->prepare(“SELECT * FROM {$this->table_name} WHERE component_name = %s AND component_id = %d AND privacy NOT IN (’exclude’) ORDER BY {$sort_by_field} {$sort_order} LIMIT %d, %d”, $this->component_name, $this->component_id, $this->offset, $this->per_page);
$placeholders = array(“%s”, “%d”, “%d”, “%d”); $query = $wpdb->prepare(str_replace(“%”, “%%”, $query), $this->component_name, $this->component_id, $this->offset, $this->per_page, $placeholders);
这应该解决该错误。如果您仍然遇到问题,请与BuddyPress相册插件的开发人员联系以获取更多帮助。