【发布时间】:2013-09-24 04:02:21
【问题描述】:
/CustomPostType.php 第 165 行
// Initialise class variables as blank
$metaKeys = $this->get_meta_keys();
foreach( $metaKeys as $key )
if( !empty( $key ) )
$this->$key = null;
$this->ID = null;
以下代码修复了语法错误。
public function get_meta_keys( $objectName) {
$getClassVars = get_class_vars( $objectName );
return array_keys( $getClassVars);
}
【问题讨论】:
-
Unexpected T_FUNCTION? 的可能重复项
-
这与 PHP 5.2 无关,与问题行中的一些奇怪语法有关,可能应该是
$getClassVars = get_class_vars( $objectName ); -
对不起,伙计们,我不是代码的开发者,这只是放在我腿上尝试修复。 - 感谢您的 cmets,每一点都有帮助!