Function Reference: geodir_search_form_near_input
Summary
This function has not been documented yet.
Actions
‘geodir_before_near_input’ [Line: 2465]
‘geodir_after_near_input’ [Line: 2475]
Filters
‘geodir_near_input_extra’ [Line: 2427]
‘geodir_search_near_text’ [Line: 2440]
‘geodir_search_default_near_text’ [Line: 2451]
‘geodir_search_near_class’ [Line: 2459]
Source File
geodir_search_form_near_input() is located in geodirectory-functions/custom_functions.php [Line: 2405]
Source Code
function geodir_search_form_near_input() {
$default_near_text = NEAR_TEXT;
if ( get_option( 'geodir_near_field_default_text' ) ) {
$default_near_text = __( get_option( 'geodir_near_field_default_text' ), 'geodirectory' );
}
if ( isset( $_REQUEST['snear'] ) && $_REQUEST['snear'] != '' ) {
$near = esc_attr( stripslashes_deep( $_REQUEST['snear'] ) );
} else {
$near = $default_near_text;
}
global $geodir_search_post_type;
$curr_post_type = $geodir_search_post_type;
/**
* Used to hide the near field and other things.
*
* @since 1.6.9
* @param string $curr_post_type The current post type.
*/
$near_input_extra = apply_filters('geodir_near_input_extra','',$curr_post_type);
/**
* Filter the "Near" text value for the search form.
*
* This is the input "value" attribute and can change depending on what the user searches and is not always the default value.
*
* @since 1.0.0
*
* @param string $near The current near value.
* @param string $default_near_text The default near value.
*/
$near = apply_filters( 'geodir_search_near_text', $near, $default_near_text );
/**
* Filter the default "Near" text value for the search form.
*
* This is the default value if nothing has been searched.
*
* @since 1.0.0
*
* @param string $near The current near value.
* @param string $default_near_text The default near value.
*/
$default_near_text = apply_filters( 'geodir_search_default_near_text', $default_near_text, $near );
/**
* Filter the class for the near search input.
*
* @since 1.0.0
*
* @param string $class The class for the HTML near input, default is blank.
*/
$near_class = apply_filters( 'geodir_search_near_class', '' );
$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
if($new_style){
echo "";
do_action('geodir_before_near_input');
}
?>
/>
";
}
}