Function Reference: geodir_predefined_custom_field_output_get_directions
Summary
Filter the get_directions custom field output to show a link.
Parameters
- $html
- (string) (required) The html to be output.
- Default: None
- $location
- (string) (required) The location name of the output location.
- Default: None
- $cf
- (object) (required) The custom field object info.
- Default: None
Return Values
- (string)
- The html to output.
Change Log
Since: 1.6.9
Source File
geodir_predefined_custom_field_output_get_directions() is located in geodirectory-functions/custom_fields_predefined.php [Line: 437]
Source Code
function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) {
global $post;
if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){
$field_icon = geodir_field_icon_proccess( $cf );
if ( strpos( $field_icon, 'http' ) !== false ) {
$field_icon_af = '';
} elseif ( $field_icon == '' ) {
$field_icon_af = '';
} else {
$field_icon_af = $field_icon;
$field_icon = '';
}
$link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' );
$html = '';
if(isset( $cf['field_icon'] ) && $cf['field_icon']){
$html .= $field_icon_af;
}
// We use maps.apple.com here because it will handle redirects nicely in most cases
$html .= '' . $link_text . '';
$html .= '';
}else{
$html ='';
}
return $html;
}