/**
 * Function to check whether scheduled post is being published. If so, apt_publish_post should be called.
 *
 * @param $new_status
 * @param $old_status
 * @param $post
 * @return void
 */
function apt_check_required_transition($new_status = '', $old_status = '', $post = '')
{
    if ('publish' == $new_status) {
        apt_publish_post($post->ID);
    }
}
/**
 * Function to check whether scheduled post is being published. If so, apt_publish_post should be called.
 * 
 * @param $new_status
 * @param $old_status
 * @param $post
 * @return void
 */
function apt_check_required_transition($new_status = '', $old_status = '', $post = '')
{
    global $post_ID;
    // Using the post id from global reference since it is not available in $post object. Strange!
    if ('publish' == $new_status) {
        apt_publish_post($post_ID);
    }
}