Remove "YES" from search filters

This topic contains 4 replies, has 3 voices, and was last updated by  Fulvio Di Stefano 2 days, 18 hours ago.

  • Author
    Posts
  • #507630

    Fulvio Di Stefano
    Full Member
    Post count: 77

    Hello, I added checkbox options as search filters, but unfortunately they show the word Yes after the box, can i remove it? this script Kiran offered doesn’t seem to work there. see screenshot to understand the issue.

    function gd_snippet_300519_remove_checkbox_yes( $html, $location, $cf, $p = '', $output = '' ) {
    	if ( $html != '' ) {
    		$html = str_replace( ': </span></span>Yes</div>', '</span></span></div>', $html );
    		$html = str_replace( '</span>Yes</div>', '</span></div>', $html );
    	}
    
    	return $html;
    }
    add_filter( 'geodir_custom_field_output_checkbox', 'gd_snippet_300519_remove_checkbox_yes', 11, 5 );
    Attachments:
    #507657

    Kor
    Moderator
    Post count: 13779

    Hi Fulvio Di Stefano,

    Thanks for your reply. I’ve just transferred this to Kiran. If possible, kindly provide WP and FTP access here in private reply.

    #507752

    Fulvio Di Stefano
    Full Member
    Post count: 77
    This reply has been marked as private.
    #507827

    Kiran
    Moderator
    Post count: 5459

    Hi Fulvio,

    I have added following PHP snippet to hide Yes from checkbox search field.

    function gd_snippet_190912_search_filter_field_html_output_checkbox( $html, $field_info, $post_type ) {
    	if ( $html != '' ) {
    		$html = str_replace( '> ' . __( 'Yes', 'geodiradvancesearch' ) . '</li></ul>', '></li></ul>', $html );
    	}
    
    	return $html;
    }
    add_filter( 'geodir_search_filter_field_html_output_checkbox', 'gd_snippet_190912_search_filter_field_html_output_checkbox', 11, 3 );

    Kiran

    #507881

    Fulvio Di Stefano
    Full Member
    Post count: 77

    Thank you kiran

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.