dqwd71332 2019-07-12 22:54
浏览 38

非wordpress自定义CMS的简码

Trying to implement my own "shortcode"-type system on my cms.

substr() can possibly work as long as there isn't more than one shortcode in the content. I can't use <?php ?>, but must use a WYSIWYG type editor for entering in the shortcode, since it is the enduser who will be entering them via the content editor.

If someone enters a "Shortcode" that follows the rules I set, this class function will discover the shortcode, parse it and then replace the shortcode with other data pulled from mysql or another source.

I can get this to work, essentially no problem, if there is not more than one single shortcode entered into the content via WYSIWYG, but more than one and it breaks.

I've looked all over the internet for this and found various things, but most of them deal with Wordpress and the few that don't aren't approaching it as I need to. Found one threat on StackOverflow which provides a potential approach that I could use, but I really need advice and a place to start more than a full function. The Wordpress Shortcode system isn't helpful either.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序