删除视觉作曲家短代码 [英] Remove visual composer shortcode

查看:22
本文介绍了删除视觉作曲家短代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用一些 preg_replace 从视觉编辑器中删除所有不必要的短代码.例如.有一些这样的元素:

I'm trying to remove all unnecessary shortcodes from visual composer with some preg_replace. E.g. there is some elements like this:

[vc_row][/vc_row][vc_row el_class="hidepdf]

最好的方法是删除 [] 之间的任何内容,以 vc_ 开头,然后是任何内容,直到结束括号 ]

The best way would be to remove anything between [] starting with vc_ and followed by anything until the end bracket ]

我已经用下面的正则表达式试过了:

I've tried it with following RegEx:

/\[[\/]?vc_*[^\]]\]/

但它似乎不起作用.

推荐答案

试试这个正则表达式 "/\[(\/*)?vc_(.*?)\]/"

这篇关于删除视觉作曲家短代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆