wordpress 加载时弹出的消息
Posted
技术标签:
【中文标题】wordpress 加载时弹出的消息【英文标题】:Messages popping up on wordpress load 【发布时间】:2016-03-12 04:54:01 【问题描述】:我试图隐藏以下在我加载任何 wordpress 页面时不断显示的消息:
Force Word Wrapping. For support / comments / whatever, visit the support forums. Version: 1.0.0 Author: Jim Wigginton Author URI: http://www.frostjedi.com/ */ function word_wrap_pass($message) $wrapAt = 70; $tempText = ''; $finalText = ''; $curCount = $tempCount = 0; $longestAmp = 9; $inTag = false; $ampText = ''; $len = strlen($message); for ($num=0;$num<$len;$num++) $curChar = $message$num; if ($curChar == '<') for ($snum=0;$snum') $tempText .= '>'; $inTag = false; elseif ($inTag) $tempText .= $curChar; elseif ($curChar == '&') for ($snum=0;$snum= $longestAmp || $curChar == ';') for ($snum=0;$snum= $maxChars) $finalText .= $tempText . ' '; $tempText = ''; $curCount = 1; else $tempText .= $curChar; $curCount++; // the following code takes care of (unicode) characters prohibiting non-mandatory breaks directly before them. // $curChar isn't a " " or "\n" if ($tempText != '' && $curChar != '') $tempCount++; // $curChar is " " or "\n", but $nextChar prohibits wrapping. elseif ( ($curCount == 1 && strstr($wrapProhibitedChars,$curChar) !== false) || ($curCount == 0 && $nextChar != '' && $nextChar != ' ' && $nextChar != "\n" && strstr($wrapProhibitedChars,$nextChar) !== false)) $tempCount++; // $curChar and $nextChar aren't both either " " or "\n" elseif (!($curCount == 0 && ($nextChar == ' ' || $nextChar == "\n"))) $tempCount = 0; if ($tempCount >= $maxChars && $tempText == '') $finalText .= ' '; $tempCount = 1; $curCount = 2; if ($tempText == '' && $curCount > 0) $finalText .= $curChar; add_filter('the_content', 'word_wrap_pass'); add_filter('comment_text', 'word_wrap_pass'); ?>
我尝试了很多不同的东西,包括 How can I stop php notices from appearing in wordpress? 中的内容。
任何帮助将不胜感激
【问题讨论】:
【参考方案1】:仅凭您显示的代码很难说...我们需要更多信息才能正确回答这个问题。但是,此消息似乎来自您的一个编码不正确的插件。我会禁用所有插件,然后一次启用一个,直到再次显示此消息。那将是您的错误插件。永久禁用/删除它...或联系作者要求他们修复它,如果你真的需要它。
【讨论】:
你是对的。我意识到这基本上没有显示任何错误,但它是从插件加载的完整 .php 文件。它在文件的开头缺少以上是关于wordpress 加载时弹出的消息的主要内容,如果未能解决你的问题,请参考以下文章
如何抑制运行 C# Winforms 应用程序时弹出的黑壳?