Function Reference: geodir_social_cpt_post_to_facebook

Change Log

Since: 1.2.6

Filters

‘geodir_social_cpt_post_to_facebook’ [Line: 1418]

Source Code

function geodir_social_cpt_post_to_facebook($post_type = '') {
    $return = false;
    
    if (empty($post_type)) {
        return $return;
    }
    
    $allowed_cpt = geodir_social_post_types_allowed();
    
    if (!isset($allowed_cpt[$post_type]) || (int)get_option('geodir_social_disable_post_to_fb')) {
        return $return;
    }
    
    $post_types = get_option('geodir_social_cpt_to_fb');
    if (empty($post_types) || (!empty($post_types) && in_array($post_type, $post_types))) {
        $return = true;
    }

    return apply_filters('geodir_social_cpt_post_to_facebook', (bool)$return);
}