{$cf['htmlvar_name']} = '1'; } if(!is_array($cf) && $cf!=''){ $cf = geodir_get_field_infoby('htmlvar_name', $cf, $gd_post->post_type); if(!$cf){return NULL;} } $html_var = $cf['htmlvar_name']; // Check if there is a location specific filter. if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ /** * Filter the checkbox html by location. * * @param string $html The html to filter. * @param array $cf The custom field array. * @param string $output The output string that tells us what to output. * @since 1.6.6 */ $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf,$output); } // Check if there is a custom field specific filter. if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ /** * Filter the checkbox html by individual custom field. * * @param string $html The html to filter. * @param string $location The location to output the html. * @param array $cf The custom field array. * @param string $output The output string that tells us what to output. * @since 1.6.6 */ $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf,$output); } // Check if there is a custom field key specific filter. if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ /** * Filter the checkbox html by field type key. * * @param string $html The html to filter. * @param string $location The location to output the html. * @param array $cf The custom field array. * @param string $output The output string that tells us what to output. * @since 1.6.6 */ $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf,$output); } // If not html then we run the standard output. if(empty($html)){ if ( (int) $gd_post->{$html_var} == 1 ): if ( $gd_post->{$html_var} == '1' ): $html_val = __( 'Yes', 'geodirectory' ); else: $html_val = __( 'No', 'geodirectory' ); endif; $field_icon = geodir_field_icon_proccess($cf); $output = geodir_field_output_process($output); if (strpos($field_icon, 'http') !== false) { $field_icon_af = ''; } elseif ($field_icon == '') { $field_icon_af = ''; } else { $field_icon_af = $field_icon; $field_icon = ''; } $html = '
'; endif; } return $html; } add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,5); /** * Get the html output for the custom field: fieldset * * @param string $html The html to be filtered. * @param string $location The location to output the html. * @param array $cf The custom field array details. * @since 1.6.6 * * @return string The html to output for the custom field. */ function geodir_cf_fieldset($html,$location,$cf,$p=''){ // check we have the post value if(is_numeric($p)){$gd_post = geodir_get_post_info($p);} else{ global $gd_post;} if(!is_array($cf) && $cf!=''){ $cf = geodir_get_field_infoby('htmlvar_name', $cf, $gd_post->post_type); if(!$cf){return NULL;} } $html_var = $cf['htmlvar_name']; // Check if there is a location specific filter. if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ /** * Filter the fieldset html by location. * * @param string $html The html to filter. * @param array $cf The custom field array. * @since 1.6.6 */ $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); } // Check if there is a custom field specific filter. if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ /** * Filter the fieldset html by individual custom field. * * @param string $html The html to filter. * @param string $location The location to output the html. * @param array $cf The custom field array. * @since 1.6.6 */ $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); } // Check if there is a custom field key specific filter. if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ /** * Filter the fieldset html by field type key. * * @param string $html The html to filter. * @param string $location The location to output the html. * @param array $cf The custom field array. * @since 1.6.6 */ $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); } // If not html then we run the standard output. if(empty($html)){ global $field_set_start; $fieldset_class = 'fieldset-'.sanitize_html_class(sanitize_title_with_dashes($cf['frontend_title'])); if ($field_set_start == 1) { $html = ''; } else { $html = '