我刚刚升级了我的WordPress到6.0.3,并在升级后得到一个致命的错误

eyh26e7m  于 2023-02-03  发布在  WordPress
关注(0)|答案(1)|浏览(142)

致命错误:无法在第4327行的/home/lh1fmg9r4ipw/public_html/wp-includes/deprecated.php中重新声明wp_get_attachment_thumb_file()(以前在/home/lh1fmg9r4ipw/public_html/wp-includes/post. php中声明过:6709)
我升级了wordpress版本到6.0.3,我无法让网站再次工作。
附件是错误消息,我看到一旦我去我的网站
在我的错误日志中,我看到许多
"[2023年1月29日19:55:40 UTC] PHP致命错误:无法在第4327行重新声明wp_get_attachment_thumb_file()(以前在/home/lh1fmg9r4ipw/public_html/wp-includes/post. php中声明过:6709)"
这里是wp-includes/deprecated.php在第4327行

/**
 * Retrieves thumbnail for an attachment.
 * Note that this works only for the (very) old image metadata style where 'thumb' was set,
 * and the 'sizes' array did not exist. This function returns false for the newer image metadata style
 * despite that 'thumbnail' is present in the 'sizes' array.
 *
 * @since 2.1.0
 * @deprecated 6.1.0
 *
 * @param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`.
 * @return string|false Thumbnail file path on success, false on failure.
 */
function wp_get_attachment_thumb_file( $post_id = 0 ) {
    _deprecated_function( __FUNCTION__, '6.1.0' );

    $post_id = (int) $post_id;
    $post    = get_post( $post_id );

    if ( ! $post ) {
        return false;
    }
    

    // Use $post->ID rather than $post_id as get_post() may have used the global $post object.
    $imagedata = wp_get_attachment_metadata( $post->ID );

    if ( ! is_array( $imagedata ) ) {
        return false;
    }

    $file = get_attached_file( $post->ID );

    if ( ! empty( $imagedata['thumb'] ) ) {
        $thumbfile = str_replace( wp_basename( $file ), $imagedata['thumb'], $file );
        if ( file_exists( $thumbfile ) ) {
            /**
             * Filters the attachment thumbnail file path.
             *
             * @since 2.1.0
             *
             * @param string $thumbfile File path to the attachment thumbnail.
             * @param int    $post_id   Attachment ID.
             */
            return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );
        }
    }

    return false;
}

/**
tkqqtvp1

tkqqtvp11#

好吧,也许这是常识,但我继续备份版本。我取代了“public_html”的解压缩文件在“application_backups”文件夹。我会知道更新所有的插件第一,然后备份,然后尝试移动到6.1.1

相关问题