I'm using following code to force WordPress page to save post as draft, is there any callback function for it, I want to alert a text after it complete saving post as draft.
if ( wp.autosave.server ) {
wp.autosave.server.triggerSave();
}
I'm using following code to force WordPress page to save post as draft, is there any callback function for it, I want to alert a text after it complete saving post as draft.
if ( wp.autosave.server ) {
wp.autosave.server.triggerSave();
}
Share
Improve this question
asked Aug 22, 2016 at 13:45
Aumkar ThakurAumkar Thakur
19710 bronze badges
1 Answer
Reset to default 8So I found the solution, callback function for when post or page is:
jQuery(document).on('heartbeat-tick.autosave', function( event, data ) {
// your code here
});
This uses the Wordpress Heartbeat API.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745070337a4609504.html
评论列表(0条)