【发布时间】:2015-11-19 16:29:50
【问题描述】:
我收到此错误:警告:“第 3211 行 /homepages/37/number/htdocs/clickandbuilds/JSSchwalmPhotography/wp-includes/functions.php 中的非法字符串偏移 'link-label'”
我没有更改此代码的任何内容。它发生在刚才。 如果有人可以帮助我消除此错误,那就太好了。谢谢!
错误在第 3211 行:“$list[ $key ] = $value[ $field ];”
这是完整的部分:
function wp_list_pluck( $list, $field, $index_key = null ) {
if ( ! $index_key ) {
/*
* This is simple. Could at some point wrap array_column()
* if we knew we had an array of arrays.
*/
foreach ( $list as $key => $value ) {
if ( is_object( $value ) ) {
$list[ $key ] = $value->$field;
} else {
$list[ $key ] = $value[ $field ];
}
}
return $list;
}
【问题讨论】: