【发布时间】:2017-12-05 19:39:05
【问题描述】:
我遇到错误
致命错误:重新定义参数 $post_id in C:\xampp\htdocs\wp-content\themes\couponer\functions.php 在第 2533 行
function coupon_smeta_images( $meta_key, $post_id, $default, $post_id){
if(class_exists('SM_Frontend')){
global $sm;
return $result = $sm->sm_get_meta($meta_key, $post_id);
}
else{
return $default;
}
}
/* check if smeta plugin is installed */
【问题讨论】:
-
你的函数构造中有两次
$post_id。 -
如前所述,您使用
$post_id作为此函数的两个单独参数。虽然我也有点担心它在第 2533 行,但可能一个文件中的代码太多? -
这是一个Wordpress主题功能文件。我不知道如何解决这个错误你能提出一些建议
-
函数 coupon_smeta_images($meta_key, $post_id, $default, $post_id)