Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WordPress的内容()可以去除数字格式样式吗?_Wordpress_Strip_Wp Editor - Fatal编程技术网

WordPress的内容()可以去除数字格式样式吗?

WordPress的内容()可以去除数字格式样式吗?,wordpress,strip,wp-editor,Wordpress,Strip,Wp Editor,我有这样一个场景,我想限制用户显示电话号码格式 简言之,我在WordPress中有一个列表网站,用户可以在其中添加自己的带有描述和其他字段的列表。用户在“描述”选项卡(前端有wp_编辑器)中添加其业务地址 现在,当列表显示我想删除电话号码或传真号码等号码格式时 我能躲在前端吗?我尝试了内容过滤器,但它不起作用。在主题的functions.php或任何相关页面中尝试以下代码-- 你能给网站链接吗?您是否也使用插件来实现这些字段?我使用了这个主题,他们有一个用于列表的inbuild inventor

我有这样一个场景,我想限制用户显示电话号码格式

简言之,我在WordPress中有一个列表网站,用户可以在其中添加自己的带有描述和其他字段的列表。用户在“描述”选项卡(前端有wp_编辑器)中添加其业务地址

现在,当列表显示我想删除电话号码或传真号码等号码格式时


我能躲在前端吗?我尝试了内容过滤器,但它不起作用。

在主题的functions.php或任何相关页面中尝试以下代码--


你能给网站链接吗?您是否也使用插件来实现这些字段?我使用了这个主题,他们有一个用于列表的inbuild inventor插件我尝试了这个但是$content返回空检查屏幕preg replace后短时间检查变量$content。。我刚刚提出了这个想法。。请你自己做一点。
add_filter('the_content','manipulate_content');
function manipulate_content($content){
 // Here manipulate your content, you can replace string which is exactly matching your format. eg is given below
 $content = preg_replace('/\d{3}([().-\s[\]]*)\d{3}([().-\s[\]]*)\d{4}/',
    "*phone*", $content);
 return $content;
}