WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make a plugin which would run either by itself at a specific time or when it is triggered manually(that is, a particular function of the plugin is triggered). I'm not understanding how to implement that though and googling around hasn't been fruitful.

If that may help, this is briefly how the function looks like.

function rrikesh_insert_post()
  $post = array([variables populated from external file]);
  wp_insert_post($post, true);

Anyone can suggest a way? Thanks

share|improve this question
up vote 2 down vote accepted

You can run scheduled events using wp_cron.

To trigger it manually you'll need to create an admin screen and create a button that triggers the function. To do that read up on Creating a Plugin and Adding Admin Menus.

share|improve this answer
Thanks, I'll be trying these! – RRikesh Jul 19 '12 at 12:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.