Thursday, August 4, 2022
HomeWordPress DevelopmentHow you can execute a hook asynchronously?

How you can execute a hook asynchronously?


Sure, that is what the WP Cron system does. It’ll hearth an motion/hook as near a requested time as it may possibly, and may do it as soon as or a number of instances.

You’ll nonetheless have a hook that runs on profile_update nevertheless it would not ship information to google spreadsheets, reasonably it will schedule a cron job that executes an motion, and you’ll ship that information on that motion.

Notice although that you will want to verify if the cron job has been scheduled already or to not keep away from duplication, and you have to to present it every part it must do its job because it won’t be the identical request ( any variables/GET/POST/FILES/and so forth won’t be accessible, new request, blanks slate ).

For info and examples of WP Cron, confer with the official plugin handbook on the WP builders website

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments