昨天升级wordpress后,我得到了这个错误。它指向我的一个插件:
/home/healt134/public_html/wp-content/plugins/video-thumbnails/video-thumbnails.php中的
警告: in_array() function.in-array:第二个参数在第402行中的数据类型错误
警告:无法修改标题信息-已由
(输出从/home/healt134/public_html/wp-content/plugins/video-thumbnails/video-thumbnails.php:402)开始,在第897行的/home/healt134/public_html/wp-includes/pluggable.php中开始
我看了402中的代码(用星号标记),但我没有看到问题或多余的空白。有人知道我能做些什么来阻止这个错误吗?
function save_video_thumbnail( $post ){
$post_type = get_post_type( $post->ID );
$video_thumbnails_post_types = get_option('video_thumbnails_post_types');
*** if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {
return null;
} else {
// Check that Video Thumbnails are enabled for current post type
if (in_array($post_type, $video_thumbnails_post_types) OR $post_type == $video_thumbnails_post_types) {
get_video_thumbnail($post->ID);
} else {
return null;
}
}
}发布于 2011-05-12 22:11:24
我想你在那里少了几行,再往下4行。我猜$video_thumbnails_post_types不是数组。
从if语句的第二个条件来看,$video_thumbnails_post_types看起来可能是标量(字符串、int等)。如果你能做到这一点,修改代码
if (in_array($post_type, (array) $video_thumbnails_post_types)
|| $post_type == $video_thumbnails_post_types)https://stackoverflow.com/questions/5984770
复制相似问题