Example #1
0
function fb_publish_later($new_status, $old_status, $post)
{
    $options = get_option('fb_options');
    // check that the new status is "publish" and that the old status was not "publish"
    if ($new_status == 'publish' && $old_status != 'publish') {
        // only publish "public" post types
        $post_types = get_post_types(array('public' => true), 'objects');
        foreach ($post_types as $post_type) {
            if ($post->post_type == $post_type->name && isset($options['social_publisher']['enabled'])) {
                fb_post_to_fb_page($post->ID);
                fb_post_to_author_fb_timeline($post->ID);
                break;
            }
        }
    }
}
function fb_publish_later($new_status, $old_status, $post)
{
    $options = get_option('fb_options');
    // check that the new status is "publish" and that the old status was not "publish"
    if ($new_status == 'publish' && $old_status != 'publish') {
        // only publish "public" post types
        if (isset($options['social_publisher']['enabled']) && isset($options['social_publisher']['publish_for']) && isset($options['social_publisher']['publish_for'][$post->post_type])) {
            fb_post_to_fb_page($post->ID);
            if (isset($options['social_publisher']['publish_to_authors_facebook_timeline'])) {
                fb_post_to_author_fb_timeline($post->ID);
            }
        }
    }
}