Title: syntax question
Last modified: August 22, 2016

---

# syntax question

 *  Resolved [wn nj](https://wordpress.org/support/users/waseemnaikgmailcom/)
 * (@waseemnaikgmailcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/)
 * hello,
 * I need to add a cron job. I am not sure what would be the syntax for it. The 
   plugin docs says I need to add:
 * wget [http://mydomainname.com/?parameters](http://mydomainname.com/?parameters).
 * can you help me on how it needs to be processed under your add task?
 * much obliged in anticipation.
 * [https://wordpress.org/plugins/advanced-cron-manager/](https://wordpress.org/plugins/advanced-cron-manager/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753182)
 * Hi wn nj,
 * Where did you found the
 * > wget [http://mydomainname.com/?parameters](http://mydomainname.com/?parameters).
 * ? In my plugin docs?
 * This snippet is propably used when you want to change your WordPress Cron to 
   Server Cron. But I don’t know where and why did you found it 🙂
 * If you want to add the Cron job just click the “Add Task” button and fill the
   simple form.
 *  Thread Starter [wn nj](https://wordpress.org/support/users/waseemnaikgmailcom/)
 * (@waseemnaikgmailcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753217)
 * Thanks Kuba,
 * I am not sure what I enter in your form.
 * in the schedule hook, do I enter just the ?parameters or the entire [http://mydomainname.com/?parameters](http://mydomainname.com/?parameters)
   without the wget?
 * can you point me in the right direction?
 * Thanks
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753218)
 * Ok here is the procedure.
 * You can add schedule hook like this:
    `my_action_name`
 * Then you can set when it should fire and optionally add parameters (one in each
   row). These can be only strings.
 * And that’s it in the admin panel.
 * To make it actually do something you must add some code into your functions.php
   theme file.
 * Like this:
 *     ```
       add_action( 'my_action_name', 'my_action_name_function' );
       function my_action_name_function() {
       	// do whatever you want
       }
       ```
   
 * Note that action hook is the one you’ve provided above in admin panel.
 *  Thread Starter [wn nj](https://wordpress.org/support/users/waseemnaikgmailcom/)
 * (@waseemnaikgmailcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753271)
 * So, my plugin has this for the front job:
 * [http://www.mydomainname.com/?pipes=cron&task=callaio](http://www.mydomainname.com/?pipes=cron&task=callaio)
 * If I put this in the browser’s address bar, it runs.
 * I cannot seem to figure out of the above, what is hook and/or the argument.
 * Can you point me in the right direction?
 * Much obliged for your continued support.
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753272)
 * Oh, now I get it 🙂
 * It’s quite simple then.
 * Your action function should look like this:
 *     ```
       add_action( 'my_action_name', 'my_action_name_function' );
       function my_action_name_function() {
       	wp_remote_get('http://www.mydomainname.com/?pipes=cron&task=callaio');
       }
       ```
   
 * Voila, cron will call your url 🙂
 * Let me know if it’s working.
 *  Thread Starter [wn nj](https://wordpress.org/support/users/waseemnaikgmailcom/)
 * (@waseemnaikgmailcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753273)
 * Can I do this suing your plugin?
 * If yes, what am I inserting for hook, and parameters?
 * If no, where would I add this? (this is the first time I am handling crons) !
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753274)
 * Yes you can, just follow steps above and add provided function in your theme’s
   function.php file
 *  Thread Starter [wn nj](https://wordpress.org/support/users/waseemnaikgmailcom/)
 * (@waseemnaikgmailcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753281)
 * OK, but I am missing a component or not making connection with your plugin; where
   am I entering how often to run the plugin?
 * Can this cron job not be entered from your plug in?
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753282)
 * “When” and “how often” you are setting in the second column when adding new cron
   job. New schedule (like every 3 hours) you can add in the sidebar metabox.
 *  Thread Starter [wn nj](https://wordpress.org/support/users/waseemnaikgmailcom/)
 * (@waseemnaikgmailcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753283)
 * OK, so I think I am beginning to understand.
 * In the functions, I need to create the function to execute the cron provided 
   by original plugin requiring cron.
 * In your plugin, I will add a new task.
 * The task hook is my_action_name_function, select the time and it should then 
   run like magic?
 * No arguments need to entered.
 * Correct?
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753286)
 * Exactly (almost) 🙂
 * Arguments are in the code – correct.
 * But action name is the Hook provided in ACM plugin. Second parameter is function
   name.
 * So:
 *     ```
       add_action( '--here is hook name--', '--here is function name--' );
       function --here is function name--() {
           --function body--
       }
       ```
   
 * Basically WP Cron calls the action, not the function itself.
 *  Thread Starter [wn nj](https://wordpress.org/support/users/waseemnaikgmailcom/)
 * (@waseemnaikgmailcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753287)
 * Kuba, you should publish this as an introduction to crons!
 * Thank you so much.
 * You have not only supported your own product but also helped me tremendously 
   in understanding what is going on. It may be trivial for you, but for me, this
   was Everest.
 * BTW, one more plug for your; I used your plugin after trying out another popular
   plugin which has not been update in a while. And that plugin is also not supported
   on the support page; worse the developer never replied me on his private domain
   email either.
 * Your plugin was able to clean up a few things the other was unable to do. You
   also have a cleaner and nicer interface and your support is the best!
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753288)
 * I’m very happy that I could help you!
 * If you’ll got any question just start new topic here 🙂
 * Thanks for all your good words!
 * I’ll be very thankful if you’d review this plugin here [https://wordpress.org/support/view/plugin-reviews/advanced-cron-manager](https://wordpress.org/support/view/plugin-reviews/advanced-cron-manager)
 * Thanks again 🙂

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘syntax question’ is closed to new replies.

 * ![](https://ps.w.org/advanced-cron-manager/assets/icon.svg?rev=3096140)
 * [Advanced Cron Manager - debug & control](https://wordpress.org/plugins/advanced-cron-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-cron-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-cron-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-cron-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-cron-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-cron-manager/reviews/)

## Tags

 * [cron](https://wordpress.org/support/topic-tag/cron/)
 * [wget](https://wordpress.org/support/topic-tag/wget/)

 * 13 replies
 * 2 participants
 * Last reply from: [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/syntax-question-2/#post-5753288)
 * Status: resolved