posts - Callback for 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 wa

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
Add a comment  | 

1 Answer 1

Reset to default 8

So 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

相关推荐

  • posts - Callback for 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 wa

    3小时前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信