howto get the new content of edited post?
Solved
Plugin Development
-
When user edit a post and submit, the new content is rendered correctly in nodebb.
However, my plugin which is listening toaction:posts.edited
, is having the old content (prior the submit) inajaxify.data.posts
.Which hook should i use to get the edited post content?
Thanks in advance!
-
Hi,
Try with this:
-
filter:post.edit
-
action:post.edit
-
action:topic.edit
The second should be enought i think.
-
-
@jarey said in howto get the new content of edited post?:
Hi,
Try with this:
-
filter:post.edit
-
action:post.edit
-
action:topic.edit
The second should be enought i think.
@jarey All 3 hooks that you listed there are server-side hooks, is there any client-side hooks that will return the new content?
-
-
The hook is passed the new content, you should be using that. IE.
$(window).on('action:posts.edited', function(ev, data) { console.log(data.post.content); });
Copyright © 2024 NodeBB | Contributors