• Resolved SNNTX

    (@kushiolk)


    Guys!
    I want to schedule a custom function to execute on the 15th of every month. Any idea to do that thing other than checking the date daily with a cron job?

    I just need to switch all users with a specific role to another on the 15th.

    Thank you ??

    • This topic was modified 2 years, 7 months ago by SNNTX.
    • This topic was modified 2 years, 7 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • You can also user a wp custom cron start at a specific time or day. Have a look at the example:

    wp_schedule_event( strtotime('16:20:00'), 'daily', 'import_into_db' );

    This would start every day at 16:20. So you could also create a job at a specific time and set it to monthly.

    The alternative to this would be to forgo a wp custom cron and use system cron. Your hosting would have to support that.

    Thread Starter SNNTX

    (@kushiolk)

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Schedule a function monthly on a specific date’ is closed to new replies.