functions - Create cron job for update translations automatically

admin2025-04-18  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
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744970500a277458.html

最新回复(0)