在 PHP 的未来版本中,与它们的类同名的将不会是构造函数

问题描述:

我正在使用 wordpress,在安装插件(Visual Composer 的无限插件)后,我收到了这些错误:

I'm using wordpress and after installing a plugin (Unlimited Addons for Visual Composer), I get those error :

在未来版本的 PHP 中,不会有与它们的类同名的构造函数;WPAlchemy_MetaBox 在第 61 行的/home/hhpariskky/www/wp-content/themes/vertical/includes/vafpress/includes/wpalchemy/MetaBox.php 中有一个已弃用的构造函数不推荐使用:与它们的类同名的方法在 PHP 的未来版本中将不再是构造函数;WPAlchemy_Taxonomy 在第 17 行的/home/hhpariskky/www/wp-content/themes/vertical/includes/vp_new/classes/taxonomy.php 中有一个已弃用的构造函数不推荐使用:与它们的类同名的方法在 PHP 的未来版本中将不再是构造函数;WPAlchemy_MetaBox1 在第 62 行的/home/hhpariskky/www/wp-content/themes/vertical/includes/vp_new/classes/MetaBox.php 中有一个已弃用的构造函数

此外,我无法删除任何插件:

Also, I cannot delete any plugin :

抑制抑制:已弃用:在未来版本的 PHP 中,与其类同名的方法将不再是构造函数;WPAlchemy_MetaBox 在/home/hhpariskky/www/wp-content/themes/vertical/includes/vafpress/includes/wpalchemy/MetaBox.php 中的第 61 行有一个已弃用的构造函数已弃用:与它们的类同名的方法将不是构造函数PHP 的未来版本;WPAlchemy_Taxonomy 在第 17 行的/home/hhpariskky/www/wp-content/themes/vertical/includes/vp_new/classes/taxonomy.php 中有一个已弃用的构造函数 弃用:与它们的类同名的方法将来不会成为构造函数PHP版本;WPAlchemy_MetaBox1 在/home/hhpariskky/www/wp-content/themes/vertical/includes/vp_new/classes/MetaBox.php 的第 62 行 {"success":true,"data":{"delete":" 中有一个已弃用的构造函数plugin","slug":"hello-dolly","plugin":"hello.php","pluginName":"Hello Dolly"}}

你能帮忙吗?

PHP 7 已弃用 带有旧的 PHP 4 样式构造函数的类:

PHP 7 deprecated classes with old, PHP 4 style constructors:

class foo {
    function foo() {
        echo 'I am the constructor';
    }
}

现在应该是:

class foo {
    function __construct() {
        echo 'I am the constructor';
    }
}

您使用的插件可能有更新版本.如果它不再获得更新,则可能需要您进行调整.

The plugin you're using may have an updated version. If it's no longer getting updates, it may be up to you to adjust it.