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
1 Answer
Reset to default 0I 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