Function Reference: geodir_location_save_cat_loc_desc
Summary
Save category and location description.
Package
GeoDirectory_Location_Manager
Parameters
- $term_id
- (int|string) (required) The term ID.
- Default: None
- $tt_id
- (int) (required) The term taxonomy ID.
- Default: None
Change Log
Since: 1.0.0
Source File
geodir_location_save_cat_loc_desc() is located in geodir_location_manager/geodir_location_hooks_actions.php [Line: 3601]
Source Code
function geodir_location_save_cat_loc_desc($term_id, $tt_id) {
if( !is_admin() ) {
return;
}
$taxonomy = isset($_REQUEST['taxonomy']) ? $_REQUEST['taxonomy'] : '';
$topdesc_type = isset($_REQUEST['topdesc_type']) ? $_REQUEST['topdesc_type'] : '';
$gd_locid = isset($_REQUEST['gd_locid']) ? $_REQUEST['gd_locid'] : '';
if (!$gd_locid || !$taxonomy) {
return;
}
$taxObject = get_taxonomy($taxonomy);
$post_type = $taxObject->object_type[0];
if (!$post_type) {
return;
}
if ( $taxonomy != $post_type . 'category' ) {
return;
}
$option = array();
$option['gd_cat_loc_default'] = (int)$topdesc_type;
$option['gd_cat_loc_cat_id'] = (int)$term_id;
$option['gd_cat_loc_post_type'] = $post_type;
$option['gd_cat_loc_taxonomy'] = $taxonomy;
$option_name = 'geodir_cat_loc_'.$post_type.'_'.$term_id;
update_option($option_name, $option);
}