大家好,我收到此错误消息:
Warning: Missing argument 2 for wpdb::prepare(), called in /home/url.com/wp-content/plugins/WPEC-Personalize-3.8/wpec-personalization.php on line 228 and 326 and defined in /home/url.com/wp-includes/wp-db.php on line 990
我在第 228 和 326 行找到了代码:
$add = $wpdb->get_var($wpdb->prepare("SELECT enabled FROM ". $table_name ." WHERE pers_id = ". $myresults->pers_id." AND product_id = ".$product_id));
并将其更改为新的 wordpress(3.5 查询)标准:
$add = $wpdb->get_var( $wpdb->prepare(
"SELECT enabled FROM %s WHERE pers_id = %d AND product_id = %d",
$table_name,
$myresults->pers_id,
$product_id
));
我不确定我做错了什么,但是当我更新下面的代码时,我停止收到错误消息,但每次我更新产品时,它都会复制插件正在创建的所有自定义字段。
参见示例:https ://www.americasfinestmailbox.com/products-page/birds/hummingbird-vertical/
任何帮助将不胜感激,因为插件作者不再支持此插件。
我在这里粘贴了整个代码:http: //www.pastebin.com/gxqEjee2
谢谢!威廉