preg_replace not replacing in a Wordpress plugin

こ雲淡風輕ζ 提交于 2019-12-07 00:36:30
Alan Moore

I believe the function needs to return the result of the replacement:

return $content;

Also, that regex doesn't look right. If you want to match a whole word in all caps, it's

'#\b[A-Z]+\b#'

Also, you want $0 (the whole match), not $1 (the first capture group, which your regex doesn't have)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!