dsfhd78978 2016-02-07 16:26
浏览 45
已采纳

在ajax响应中的Wordpress Post编辑屏幕中填充内容和特色图像

I am stuck again. I am working on Wordpress Post edit screen in which i need to populate post content and post Featured image from an Ajax Response. I tried a lot myself but it didn't work for Content Editor because Wordpress use tinymce editor as WYSIWYG editor. Any idea how to do this? I also need to populate image for which I am receiving image url from the AJAX response and I need to set this images as featured image in Wordpress Post edit screen.

Any help will be appreciated.

  • 写回答

1条回答 默认 最新

  • dongyou6847 2016-02-09 02:38
    关注

    Well, i found a way to set content in WP Content Editor using the ajax response. Below is the code.

    tinyMCE.activeEditor.setContent(response.DESCRIPTION);
    

    Using this you can set content in the Content Editor of Post Edit screen. Wordpress uses TinyMCE WYSIWYG Editor for it Content Editor. :D

    But i still need to search how to set featured_image using ajax response. This is the second thing left in question

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题