如何修复WordPress中的Pluggable.php文件错误

Are you seeing a pluggable.php file error on your WordPress site? Sometimes when you add a code snippet on your site or activate a new plugin, you may get the pluggable.php file error. In this article, we will show you how to fix pluggable.php file errors in WordPress.

您是否在WordPress网站上看到了pluggable.php文件错误? 有时,当您在网站上添加代码段或激活新的插件时,可能会收到pluggable.php文件错误。 在本文中,我们将向您展示如何修复WordPress中的pluggable.php文件错误。

Fix errors in pluggable.php file in WordPress
什么时候以及为什么看到Pluggable.php错误? (When and Why You See Pluggable.php Errors?)

WordPress allow users and plugins to override certain core functions. These functions are located in the pluggable.php file.

WordPress允许用户和插件覆盖某些核心功能。 这些功能位于pluggable.php文件中。

If a WordPress plugin or a custom code snippet fails to correctly handle one of these functions, then you will see an error like this one:

如果WordPress插件或自定义代码段未能正确处理以下功能之一,则您将看到类似以下错误:

Warning: Cannot modify header information – headers already sent by (output started at /home/username/demosite/wp-content/themes/mytheme/functions.php:1035) in /home/username/demosite/wp-includes/pluggable.php on line 1179

警告:无法修改标头信息–已发送的标头(输出始于/ home / username / demosite / wp-includes / pluggable中的/home/username/demosite/wp-content/themes/mytheme/functions.php:1035) 1179行上的php

Example of an error in WordPress mentioning pluggable.php file

Sometimes you may be able to continue working on your site with this or some other error still appearing in the admin area.

有时候,您可能可以继续在网站上工作,但管理区域中仍然会出现此错误或其他错误。

Error in WordPress admin area

Having said that, let’s take a look at how to easily fix pluggable.php file error in WordPress.

话虽如此,让我们看一下如何轻松修复WordPress中的pluggable.php文件错误。

修复WordPress中的Pluggable.php文件错误 (Fixing Pluggable.php File Errors in WordPress)

The pluggable.php file is a core WordPress file. It’s never a good idea to edit the core WordPress file as your first option, even when there is an error pointing to them.

plugin.php文件是WordPress的核心文件。 编辑核心WordPress文件作为您的第一选择绝不是一个好主意,即使指向它们的错误也是如此。

Most likely than not, the error is coming from a different location.

该错误很可能是来自其他位置。

In order to fix any error mentioning pluggable.php file, just look at the first location mentioned in the error.

为了解决任何提及提到pluggable.php文件的错误,只需查看错误中提到的第一个位置。

Warning: Cannot modify header information – headers already sent by (output started at /home/username/demosite/wp-content/themes/mytheme/functions.php:1035) in /home/username/demosite/wp-includes/pluggable.php on line 1179

警告:无法修改标头信息–已发送的标头(输出始于/ home / username / demosite / wp-includes / pluggable中的/home/username/demosite/wp-content/themes/mytheme/functions.php:1035) 1179行上的php

In the above example, the error is located in the theme’s functions.php file at line 1035.

在上面的示例中,错误位于主题的functions.php文件中的第1035行。

This means you need to edit your theme’s functions.php file and change or remove the code causing this error.

这意味着您需要编辑主题的functions.php文件,并更改或删除导致此错误的代码。

Sometimes the headers already sent error is caused by an extra space after closing the php ?> tag, so you can just remove that, and it will fix the issue.

有时,已经发送的标头错误是由关闭php?>标记后多余的空间引起的,因此您可以删除该标记,它将解决此问题。

Let’s take a look at another example:

让我们看另一个例子:

Warning: Cannot modify header information – headers already sent by (output started at /home/username/demosite/wp-content/plugins/some-plugin-name/some-plugin.php:144) in /home/username/demosite/wp-includes/pluggable.php on line 1090

警告:无法修改标头信息–已在/ home / username / demosite /中发送的标头(输出始于/home/username/demosite/wp-content/plugins/some-plugin-name/some-plugin.php:144)第1090行的wp-includes / pluggable.php

This error message is pointing to a plugin on your WordPress site causing the error. You can simply deactivate the plugin and notify the plugin author about the error.

此错误消息指向导致该错误的WordPress网站上的插件。 您可以简单地停用插件,然后将错误通知插件作者。

In almost all cases, errors mentioning pluggable.php file are not caused by the file itself.

在几乎所有情况下,提及pluggable.php文件的错误并非由文件本身引起。

These errors are usually caused by a custom code snippet you added to functions.php file, or a poorly coded plugin, or even your WordPress theme.

这些错误通常是由您添加到functions.php文件中的自定义代码段 ,编码不良的插件甚至WordPress主题引起的

Simply removing or editing the code or deactivating the plugin will make the error go away.

只需删除或编辑代码或停用插件 ,错误就会消失。

Still can’t figure out what’s causing these errors?

仍然不知道是什么原因导致这些错误?

Follow instructions in our step by step guide for troubleshooting WordPress errors. It will help you find out the cause of the error and how to quickly fix it.

请按照我们的逐步指南中的说明对WordPress错误进行故障排除 。 这将帮助您找出错误的原因以及如何快速修复它。

We hope this article helped you resolve pluggable.php file errors in WordPress. You may also want to bookmark our list of most common WordPress errors and how to fix them.

我们希望本文能帮助您解决WordPress中的pluggable.php文件错误。 您可能还想将最常见的WordPress错误列表以及如何修复这些书签添加为书签。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-fix-pluggable-php-file-errors-in-wordpress/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值