WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Making a hook in functions.php

[Resolved] Making a hook in functions.php

  • Hi,

    I am attempting to create a cron job for WordPress that will create a mailchimp campaign and send it out – it is to include wp-insert ads using the php function provided. That is somewhat beside the point. I have set up the hook and cron job correctly; the text part is all peachy but the php wp-insert function returns an empty div container. My suspicion is that the shortcode that the function uses is not yet defined in functions.php. Where can I define this hook so that it will successfully call wp_template_ad() and return the ad code but also be utilized by cron jobs?

    Essentially I think I can solve the problem if these questions are answered:

    – Where/when is the shortcode used in wp_template_ad defined?
    – Where can I define hooks for them to be accessible to wp-cron jobs (I am using the plugin crontrol)?

    Any help would be greatly appreciated,
    Gabe

    http://wordpress.org/plugins/wp-insert/

Viewing 1 replies (of 1 total)
  • I solved the problem.

    The function wp_template_ad echos the result. I was trying to store it in a variable and append it to the html. I needed to return it rather than echo it, and this fixed the problem in case anybody else decides to try something similar.

    Hope this helps someone – Cheers!
    Gabe

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Making a hook in functions.php’ is closed to new replies.