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

php - CRON job to update wp_usermeta value each day or week based on server time

programmeradmin1浏览0评论

My Wordpress site has a registration field that asks members how many weeks pregnant they are.

If a member insert 5 then 7 days later that integer needs to increase to 6.

Pseudo code for what I want is:

If mysite_user_weekspregnant > 0
   get current_day++

   case current_day => 1 and <= 7
      set week 1
   case current_day > 7 and <= 14
      set week 2
   ...
   ...
   case current_day > 273 and <= 270
      set week 40

mysite_user_weekspregnant is stored within table: wp_usermeta.

How do I turn this into a CRON job?

发布评论

评论列表(0)

  1. 暂无评论