简体   繁体   English

无法使用 Page Builder 更新主题页面

[英]Cant update theme pages using Page Builder

We are currently migrating our site from php 5.6 to 7.2 as our hosts have set a fixed end of life for this.我们目前正在将我们的站点从 php 5.6 迁移到 7.2,因为我们的主机已为此设置了固定的生命周期。

We are using BeTheme and we can see that most features are intact, however when updating posts the site breaks when the muffin builder existing layouts, this largely is due to a我们正在使用 BeTheme,我们可以看到大多数功能都完好无损,但是在更新帖子时,当松饼构建器现有布局时,站点会中断,这主要是由于

Fatal error: Uncaught Error: [] operator not supported for strings in /XXXXX/wp-content/themes/XXXXX/functions/meta-functions.php致命错误:未捕获错误:/XXXXX/wp-content/themes/XXXXX/functions/meta-functions.php 中的字符串不支持 [] 运算符

$mfn_items[$newParentSectionID]['items'][] = $item;

Any ideas to prevent this?有什么想法可以防止这种情况吗?

You get this error when attempting to use the short array push syntax on a string.尝试对字符串使用短数组推送语法时会出现此错误。

For example, this例如,这个

$foo = 'foo';
$foo[] = 'bar'; // ERROR!

It seems there are some issues with PHP 7 and code using the empty-index array push syntax. PHP 7 和使用空索引数组推送语法的代码似乎存在一些问题。

To make it clear, these work fine in PHP 7+为了清楚起见,这些在 PHP 7+ 中工作正常

$previouslyUndeclaredVariableName[] = 'value'; // creates an array and adds one entry

$emptyArray = []; // creates an array
$emptyArray[] = 'value'; // pushes in an entry

you need to edit your code.你需要编辑你的代码。

like this像这样

$mfn_items = array();
$mfn_items[$newParentSectionID]['items'][] = $item;

more details you can read here您可以在此处阅读更多详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM