This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // you proably don't need this line | |
// add the custom field to the custom field list | |
function geodir_custom_field_distance_to($custom_fields,$post_type){ | |
$custom_fields['distance_to'] = array( // The key value should be unique and not contain any spaces. | |
'field_type' => 'text', // | |
'class' => 'gd-distance-to', | |
'icon' => 'fa fa-map-marker', | |
'name' => __('Distance To', 'geodirectory'), | |
'description' => __('Adds a input for GPS coordinates that will then output the place distance to that point.', 'geodirectory'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add a new output location to the list of places a custom field can be output. | |
add_filter('geodir_show_in_locations','_content_location_below_profile_content',10,3); | |
function _content_location_below_profile_content($show_in_locations,$field_info,$field_type){ | |
$show_in_locations['[below_content_tab]'] = __("Below Content Tab", 'geodirectory'); | |
return $show_in_locations; | |
} | |
// Output the custom field info in a new place, in this case below the profile tab content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('geodir_detail_page_tab_list_extend','_my_more_info_tab_name',10,1); | |
function _my_more_info_tab_name($tabs){ | |
if(isset($tabs['post_info'])){ | |
$tabs['post_info']['heading_text'] = __( 'Something else', 'geodirectory' ); | |
} | |
return $tabs; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?pho // you probably dont need this | |
add_action('geodir_after_listing_post_excerpt','_my_default_desc_listview',10,1); | |
function _my_default_desc_listview($post){ | |
if($post->post_content==''){ | |
echo "this is a default description, if blank"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// replace 222 with the category id | |
remove_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2); | |
add_filter('geodir_custom_field_input_taxonomy','_my_default_taxonomy',10,2); | |
function _my_default_taxonomy($html,$cf){ | |
if(isset($cf['post_type']) && $cf['post_type']=='gd_place'){ | |
$html = "<input type='hidden' name='post_category[gd_placecategory][]' value='222' />"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// filter home map to only show claimed listings | |
add_filter('geodir_marker_search','_my_filter_home_map_claimed',10,1); | |
function _my_filter_home_map_claimed($search){ | |
$search = " AND pd.claimed=1 " . $search; | |
return $search; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('geodir_filter_title_variables_vars','_my_new_title_meta_vars',10,4); | |
function _my_new_title_meta_vars($title, $location_array, $gd_page, $sep){ | |
if ( strpos( $title, '%%post_address%%' ) !== false ) { | |
global $post; | |
$var = geodir_get_post_meta($post->ID,'post_address',true); | |
$title = str_replace( "%%post_address%%", $var, $title ); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('geodir_sendEmail_message_admin_bcc','_my_admin_bcc_extra_info',10,11); | |
function _my_admin_bcc_extra_info($message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id){ | |
if($message_type == 'post_submit'){ | |
$message .= " \n \n"; | |
$message .= "PACKAGE ID: ".geodir_get_post_meta($post_id, 'package_id', true); | |
$message .= " \n"; | |
$message .= "COUNTRY : ".geodir_get_post_meta($post_id, 'post_country', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('geodir_details_schema','_my_new_schema',10,2); | |
function _my_new_schema($schema,$post){ | |
$schema = array();// this will reset the scheme, maybe you just want to edit what is there? | |
$schema['telephone'] = '1234'; // edit an existing schema | |
$schema['telephoneX'] = '1234'; // add a new schema value | |
unset($schema['telephone']); // remove a schema key/value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('geodir_create_marker_jason_of_posts','_my_change_cat_map_markers_to_current_cat',11,2); | |
function _my_change_cat_map_markers_to_current_cat($marker_json,$post){ | |
global $gd_cur_term_icon_url; | |
if(geodir_is_page('listing') && is_tax()){ | |
if(!$gd_cur_term_icon_url){ | |
$term_icon_url = get_tax_meta(get_queried_object()->term_id, 'ct_cat_icon', false, $post->post_type); |