WordPress.org

Ready to get started?Download WordPress

Forums

Daily argument in wp_schedule_event() (3 posts)

  1. patrix
    Member
    Posted 4 years ago #

    I want to use the 'daily' argument in wp_schedule_event() function. when scheduled to run once a day, at what time does it run? Does it depend on your server clock or uses GMT?

    Can we specify an hour at which the 'daily' argument should run?

  2. David Miller
    Member
    Posted 4 years ago #

    You can specify when the daily argument should run by using something other than 'time()' for the $timestamp value. For example, if you wanted to schedule an event to run at noon each day you could use mktime(12,0,0,date('m'),date('d'),date('Y')) as your $timestamp value - it should fire based on your server clock. It will fire daily starting at the $timestamp you give.

    Hope that helps.

  3. patrix
    Member
    Posted 4 years ago #

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic