【问题标题】:Wordpress WYSIWYG image links brokenWordpress 所见即所得图像链接已损坏
【发布时间】:2013-01-21 10:48:26
【问题描述】:

在自定义插件中,我像这样调用所见即所得编辑器:

<?php the_editor(get_option("reminder_text"), 'reminder_text'); ?>

一切正常,直到我尝试插入图像(上传器或外部源,没有区别)。

示例:我输入图片路径,图片显示正确。当我保存表单并返回它时,图像显示为已损坏,并且路径被转义引号包围,例如。 g.:

\"http://www.my-image-link-here.jpg\"

有人知道如何解决这个问题吗?

【问题讨论】:

    标签: image wordpress tinymce wysiwyg


    【解决方案1】:

    这是因为数据在插入数据库时​​被清理了,需要清理get_option的返回结果。

    查看有关 Data Validation 的文档。

    用途:

    the_editor( esc_attr( get_option( "reminder_text" ) ), 'reminder_text' );
    

    Related answer 在 WordPress StackExchange。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多