Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.