gpt4 book ai didi

image - Wordpress 所见即所得图像链接损坏

转载 作者:行者123 更新时间:2023-12-05 08:01:25 24 4
gpt4 key购买 nike

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

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

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

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

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

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

最佳答案

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

查看有关 Data Validation 的文档.

使用:

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

Related answer在 WordPress StackExchange。

关于image - Wordpress 所见即所得图像链接损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14436979/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com