Support » Plugins » Hacks » Get the $post array when a scheduled post is made live

  • Hi all,

    Silly problem to have but hopefully you guys can help me solve it.

    I have a function that gets called whenever a post is published and it works like a charm except with a scheduled post is made live, the $post variable is empty but, it triggers the code.

    The result, is that 99% of the time posts trigger the function correctly. In the rare example of a scheduled post, the function is triggered but with an empty array.

    Can anybody suggest where to begin? Neither the $post_id or $post are populated in this one circumstance.

    Here’s the code:

    function stocktwits_curation_send_report($post_id, $post) {
    	//extract data from the post
    	//set POST variables
    	$fields = array(
    	//url-ify the data for the POST
    	foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
    	// do fancy curl stuff here


  • The topic ‘Get the $post array when a scheduled post is made live’ is closed to new replies.