how to write a plugin that runs automatically (3 posts)

  1. feelexit
    Posted 7 years ago #

    I write a plugin that creates weekly summery post. it supposed to run once a week to generate a post for current week.

    I can have a cron job to schedule a task to run it once a week, but since its a plugin, you need to login as admin first, but cron job wont be able to do that. Is there a way I can do it ?

  2. feelexit
    Posted 7 years ago #

    please help.

  3. k_nitin_r
    Posted 7 years ago #

    What you can do to simulate a scheduled job is to create a script with a wget that calls a Php file in the plugin directory. You can schedule the script to get the Php page to run every week. To avoid accidentally creating a summary more than once, you can store the last execution date to ensure that a week has passed since the last summary post.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.