• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

给WordPress的新评论添加微信提醒

网络资源 Liam 1年前 (2019-04-28) 133698次浏览 794个评论 扫描二维码
文章目录[隐藏]

前言

用Wordpress建站的朋友都知道文章有评论回复是可以加上邮件提醒的,用php或smtp的方式都可以。但是能不能别人给你留言了也有微信推送提醒呢,答案是可以的。当然这里有个局限性就是仅仅提醒博主自己,需要准备的就是一个Github账号和一个微信号。
用到的服务就是Server酱。Server酱是什么?

   「Server酱」,英文名「ServerChan」,是一款「程序员」和「服务器」之间的通信软件。     说人话?就是从服务器推报警和日志到手机的工具。     开通并使用上它,只需要一分钟:     登入:用GitHub账号登入网站,就能获得一个SCKEY(在「发送消息」页面)     绑定:点击「微信推送」,扫码关注同时即可完成绑定     发消息:往 http://sc.ftqq.com/SCKEY.send 发GET请求,就可以在微信里收到消息啦 

正如 Server酱的介绍所言,先通过 GitHub 账号登录,获取 SCKEY,然后用你自己的 SCKEY 替换下面代码中的相应字段。

//评论微信推送 function sc_send($comment_id) { $text = '博客上有一条新的评论'; $comment = get_comment($comment_id); $desp = $comment->comment_content; $key = '你自己的SCKEY'; $postdata = http_build_query( array( 'text' => $text, 'desp' => $desp ) );  $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); return $result = file_get_contents('http://sc.ftqq.com/'.$key.'.send', false, $context); } add_action('comment_post', 'sc_send', 19, 2);

将这段代码粘贴到 function.php 的末尾并保存。最后,绑定 Server酱的微信号,就可以从微信上接收别人给你博客的评论内容啦。
原文引用:http://xiaolei.tech/gei-wordpress-de-xin-ping-lun-tian-jia-wei-xin-ti-xing.html


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:给WordPress的新评论添加微信提醒
喜欢 (1)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(794)个小伙伴在吐槽
  1. can you be is cvs 9d11 is best is price
    RicksonBossonitado2020-05-29 06:39 (17分钟前)回复 Windows 8.1 | Chrome 65.0.3325.146
  2. is york 9d11 is nrnberg
    RicksonBossonitado2020-05-29 06:29 (27分钟前)回复 Windows 7 | Chrome 66.0.3359.181
  3. looking good at the is now 9d11 wow is being online
    RicksonBossonitado2020-05-29 06:11 (45分钟前)回复 Windows 7 | Chrome 67.0.3396.99
  4. levitra vs is vs is 9d11 come comperare is
    RicksonBossonitado2020-05-29 02:12 (5小时前)回复 Windows 7 | Chrome 67.0.3396.87
  5. reliable website be is aa64 is kostenlos probe
    NhuMassaroitado2020-05-28 15:00 (16小时前)回复 Windows 7 | Chrome 67.0.3396.87
  6. is vs levitra dosage aa64 is ohne rezept deutschland
    NhuMassaroitado2020-05-28 14:52 (16小时前)回复 Windows 10 | Chrome 68.0.3440.106
  7. is la pillola aa64 pink female is
    NhuMassaroitado2020-05-28 14:40 (16小时前)回复 Windows 7 | Chrome 67.0.3396.87
  8. is sale cheap price aa64 being is china
    NhuMassaroitado2020-05-28 14:18 (17小时前)回复 Windows 10 | Chrome 65.0.3325.181
  9. does is help trat bph aa64 at is no such thing
    NhuMassaroitado2020-05-28 14:08 (17小时前)回复 Windows 10 | Chrome 67.0.3396.99
  10. works better than is aa64 brand is with prescription
    NhuMassaroitado2020-05-28 13:52 (17小时前)回复 Windows 7 | Chrome 67.0.3396.87
  11. is at is just as good aa64 acquistare is foru
    NhuMassaroitado2020-05-28 13:42 (17小时前)回复 Windows 8.1 | Chrome 65.0.3325.146
  12. come is senza ricett aa64 where to be is in glasgow
    NhuMassaroitado2020-05-28 13:30 (17小时前)回复 Windows 7 | Chrome 67.0.3396.99
  13. be is rome on this page aa64 is kopie
    NhuMassaroitado2020-05-28 13:08 (18小时前)回复 Windows 7 | Chrome 67.0.3396.99
  14. ato do is precos aa64 is be online is
    NhuMassaroitado2020-05-28 12:47 (18小时前)回复 Windows 7 | Chrome 67.0.3396.99
  15. is por interne aa64 is ato funciona
    NhuMassaroitado2020-05-28 12:46 (18小时前)回复 Windows 10 | Chrome 64.0.3282.140
  16. be on line is in sa aa64 is rezept schweiz
    NhuMassaroitado2020-05-28 12:26 (19小时前)回复 Windows 8.1 | Chrome 65.0.3325.146
  17. wow look it best be is aa64 is online jamaica
    NhuMassaroitado2020-05-28 12:11 (19小时前)回复 Windows 7 | Chrome 67.0.3396.87
  18. why does is pills say ert aa64 can you be is per pill
    NhuMassaroitado2020-05-28 11:55 (19小时前)回复 Windows 10 | Chrome 68.0.3440.75
  19. is sale cheap price aa64 we use it be is is
    NhuMassaroitado2020-05-28 11:39 (19小时前)回复 Windows 7 | Chrome 68.0.3440.106
  20. is no prescription in usa aa64 is online uk
    NhuMassaroitado2020-05-28 11:31 (19小时前)回复 Windows 7 | Chrome 67.0.3396.87
  21. is sicuro online aa64 click here to be plus is
    NhuMassaroitado2020-05-28 11:12 (20小时前)回复 Windows 7 | Chrome 68.0.3440.84
  22. is is shop aa64 click here is where to be
    NhuMassaroitado2020-05-28 11:03 (20小时前)回复 Windows 7 | Chrome 67.0.3396.87
  23. be is with e check aa64 low cost is us
    NhuMassaroitado2020-05-28 10:41 (20小时前)回复 Windows 8.1 | Chrome 68.0.3440.84
  24. walmart is price aa64 how much does is cost 2012
    NhuMassaroitado2020-05-28 10:37 (20小时前)回复 Windows 10 | Chrome 67.0.3396.87
  25. come is senza ricett aa64 best herbal is for women
    NhuMassaroitado2020-05-28 10:29 (20小时前)回复 Windows 7 | Chrome 66.0.3359.181
  26. cocaine and is aa64 only now order is usa
    NhuMassaroitado2020-05-28 10:23 (21小时前)回复 Windows 10 | Chrome 66.0.3359.170
  27. is coupon aa64 free is samples canada
    NhuMassaroitado2020-05-28 09:58 (21小时前)回复 Windows 10 | Chrome 67.0.3396.87
  28. commander du is en france aa64 is recreational drug use
    NhuMassaroitado2020-05-28 09:51 (21小时前)回复 Windows 7 | Chrome 68.0.3440.84
  29. i use it inexpensive is aa64 be turkish at is
    NhuMassaroitado2020-05-28 09:31 (21小时前)回复 Windows 8.1 | Chrome 66.0.3359.181
  30. the cost for is aa64 walmart cost of is 2012
    NhuMassaroitado2020-05-28 09:13 (22小时前)回复 Windows 7 | Chrome 68.0.3440.84
  31. coste de pldora is aa64 at is no such thing
    NhuMassaroitado2020-05-28 09:10 (22小时前)回复 Windows 8.1 | Chrome 66.0.3359.181
  32. is effetto economico aa64 is pfizer le moins cher
    NhuMassaroitado2020-05-28 08:43 (22小时前)回复 Windows 7 | Chrome 67.0.3396.87
  33. is naturale africano aa64 is effetto economico
    NhuMassaroitado2020-05-28 08:32 (22小时前)回复 Windows 10 | Chrome 68.0.3440.75
  34. I wanted to put you the little remark to help give thanks yet again just for the breathtaking methods you've provided here. It has been simply strangely open-handed of people like you to provide easily just what a few individuals might have supplied for an e book to earn some money on their own, and in particular considering that you might have done it if you considered necessary. These tips additionally acted like a easy way to know that other people have the same fervor just as my personal own to know a lot more in regard to this matter. I believe there are several more fun instances up front for many who check out your blog post.
    lebron shoes2020-05-28 08:26 (23小时前)回复 Windows 7 | 未知浏览器
  35. is acheter en lign aa64 commander du is en france
    NhuMassaroitado2020-05-28 08:13 (23小时前)回复 Windows 10 | Chrome 65.0.3325.181
  36. cheap is 200mg aa64 wow at is mexico
    NhuMassaroitado2020-05-28 08:11 (23小时前)回复 Windows XP | Chrome 49.0.2623.112
  37. Thanks! And thanks for sharing your great posts every week!
    Greig2020-05-27 18:15 (2天前)回复 Windows XP | Internet Explorer 6.0
  38. female is vente 26d8 is rezeptfrei stuttgart
    WillamsDrueitado2020-05-27 12:08 (2天前)回复 Windows 10 | Chrome 68.0.3440.106
  39. precio is uso diari 26d8 pillola di peso is
    WillamsDrueitado2020-05-27 11:22 (2天前)回复 Windows 10 | Chrome 58.0.3029.110
  40. is libido 26d8 acquisto is con postepay
    WillamsDrueitado2020-05-27 10:58 (2天前)回复 Windows 7 | Chrome 66.0.3359.170
  41. prix du is generique 26d8 at is cipla
    WillamsDrueitado2020-05-27 10:04 (2天前)回复 Windows 8.1 | Chrome 68.0.3440.84
  42. is 20 mg acheter 26d8 is tadalafil best value
    WillamsDrueitado2020-05-27 09:53 (2天前)回复 Windows 10 | Chrome 66.0.3359.181
  43. is age range 26d8 athes is tadalafil
    WillamsDrueitado2020-05-27 09:19 (2天前)回复 Windows 10 | Chrome 67.0.3396.87
  44. cheap 40 mg is online 26d8 rate our speists
    WillamsDrueitado2020-05-27 08:50 (2天前)回复 Windows 10 | Chrome 68.0.3440.106
1 14 15 16