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

functions - Create cron job for update translations automatically

programmeradmin0浏览0评论

I would like to set cron job in WordPress with WP Crontrol for update translations automatically. If I saw it right I have to create a PHP code (simple plugin) and then schedule it with mentioned plugin. How is it possible?

I would like to set cron job in WordPress with WP Crontrol for update translations automatically. If I saw it right I have to create a PHP code (simple plugin) and then schedule it with mentioned plugin. How is it possible?

Share Improve this question asked Nov 16, 2019 at 20:26 FerimanFeriman 2892 silver badges9 bronze badges 1
  • you don't need this plugin if you create your own. read this : developer.wordpress/plugins/cron/… – Kaperto Commented Nov 16, 2019 at 21:29
Add a comment  | 

1 Answer 1

Reset to default 0

I found wp cli based solution. These below commands are useful for update translate files for core, themes and plugins:

wp language core update
wp language theme update --all
wp language plugin update --all

To schedule these commands, insert this line in crontab:

30 0 * * * wp language core update ; wp language theme update --all ; wp language plugin update --all

It will update all translate files once a day.

Shorter version of cron job:

30 0 * * * for i in "core update" "theme update --all" "plugin update --all"; do sudo wp  language $i; done
发布评论

评论列表(0)

  1. 暂无评论