我的自定义帖子类型缩略图似乎工作正常。
然而,当我返回编辑我的一个物种配置文件时(在管理区域,这里不谈前端),以下文本直接在我的元框中的特征图像上方涂鸦:
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 537
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 537
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 543
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 543
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 550
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 550
我知道我可以通过更改
WP_DEBUG
但我不愿意在现阶段这样做(仍在开发CMS)。
EDIT
我用来实现此功能的唯一代码是我插件中的这一行:
\'supports\' => array(\'author\',\'thumbnail\',\'excerpt\',\'comments\')
.. 这一行在我的主题功能中。php:
add_theme_support( \'post-thumbnails\', array( \'post\', \'species\' ) );
** 编辑2**
该错误实际上也发生在“我的媒体库”页面上:
**编辑3**
这是来自的代码media.php
. 第537至550行。
if ( ( $data[\'width\'] == $size[0] && $data[\'height\'] <= $size[1] ) || ( $data[\'height\'] == $size[1] && $data[\'width\'] <= $size[0] ) ) {
$file = $data[\'file\'];
list($width, $height) = image_constrain_size_for_editor( $data[\'width\'], $data[\'height\'], $size );
return compact( \'file\', \'width\', \'height\' );
}
// add to lookup table: area => size
$areas[$data[\'width\'] * $data[\'height\']] = $_size;
}
if ( !$size || !empty($areas) ) {
// find for the smallest image not smaller than the desired size
ksort($areas);
foreach ( $areas as $_size ) {
$data = $imagedata[\'sizes\'][$_size];
if ( $data[\'width\'] >= $size[0] || $data[\'height\'] >= $size[1] ) {
**编辑4**
当我不使用字符串格式时,也会出现此错误<?php the_post_thumbnail( \'indexleft-species-thumb\' ); ?>
. 如果我使用<?php the_post_thumbnail( array(200,200) ); ?>
它将显示与上述相同的错误。
**编辑5**
var\\u按要求转储:
一
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 537
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 537
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 543
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 543
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 550
Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 550
有什么想法吗?
提前感谢,