简体   繁体   English

如何使用wp_update_post在WordPress文本编辑器中附加内容

[英]How to append content in WordPress Text Editor with wp_update_post

I'm trying to make a chat with WordPress. 我正在尝试与WordPress聊天。 I'm looking for a way to append part of content in the end of an existing content in WordPress Editor . 我正在寻找一种在WordPress编辑器中将部分内容追加到现有内容的末尾的方法。 I suppose I need to use wp_update_post and in the 'post_content' somehow I need to append the new content, not replacing it. 我想我需要使用wp_update_post ,在“ post_content”中我需要以某种方式附加新内容,而不是替换它。 Do you know some way to do that? 你知道这样做的方法吗? Thanks in advance. 提前致谢。

you can use Jquery for this. 您可以为此使用Jquery。

$("your tag ").append("<b>Appended in parent</b>");
$("your tag ").after("<b>Appended after parent</b>");
$("your tag ").before("<b>Appended before parent</b>");
$("your tag ").prepend("<b>Appended before parent</b>");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM