最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

rest api - Do something when publish a post in Gutenberg with hook rest_after_insert_post

programmeradmin0浏览0评论

I want to send my post to Telegram when it is created. I have read discussion here and inspected these code from n7studio, but my function send_posts_to_Telegram doesn't fire when I publish post. Isn't rest_after_insert_post fire when post are being published from REST API and Gutenberg?

add_action('rest_after_insert_post', 'send_posts_to_Telegram', 10, 3);

function send_posts_to_Telegram($post, $request, $creating = true){
//Send post to Telegram
}
发布评论

评论列表(0)

  1. 暂无评论