Function Reference: gdfi_facebook_integration_from_submit_handler

Summary

This function has not been documented yet.

Source Code

function gdfi_facebook_integration_from_submit_handler() {
    if (isset($_REQUEST['gdfi_facebook_integration_options_save'])) {
        $gdfi_config = get_option('gdfi_config');
        if (!$gdfi_config) {
            $gdfi_config_new = array('app_id' => $_REQUEST['gdfi_app_id'], 'app_secret' => $_REQUEST['gdfi_app_secret']);
        } else {
            $gdfi_config_new = $gdfi_config;
        }

        if (!empty($_REQUEST['gdfi_app_id'])) {
            $gdfi_config_new['app_id'] = $_REQUEST['gdfi_app_id'];
        }
        if (!empty($_REQUEST['gdfi_app_secret'])) {
            $gdfi_config_new['app_secret'] = $_REQUEST['gdfi_app_secret'];
        }
        if (isset($_REQUEST['gdfi_app_page_post'])) {
            $gdfi_config_new['app_page_post'] = $_REQUEST['gdfi_app_page_post'];
        }
        
        $disable_post_to_fb = !empty($_REQUEST['geodir_social_disable_post_to_fb']) ? 1 : 0;
        $geodir_social_cpt_to_fb = !empty($_REQUEST['geodir_social_cpt_to_fb']) ? $_REQUEST['geodir_social_cpt_to_fb'] : '';
        $disable_auto_post = !empty($_REQUEST['geodir_social_disable_auto_post']) ? 1 : 0;
        update_option('geodir_social_disable_post_to_fb', $disable_post_to_fb);
        update_option('geodir_social_cpt_to_fb', $geodir_social_cpt_to_fb);
        update_option('geodir_social_disable_auto_post', $disable_auto_post);

        update_option('gdfi_config', $gdfi_config_new);
    }
}