• Hi,
    I am finding the filter is not working for placeholders on the dropdown with select2….

    
    add_filter( 'beautiful_filters_dropdown_placeholder', 'modify_dropdown_placeholder', 10, 2 );
    
    	function modify_dropdown_placeholder( $placeholder, $taxonomy ) {
    
    	    return  'Select from the below';
    	}
    

    It just returns an empty string…

    
    <span class="select2-selection__rendered" id="select2-select-button-container" title=" "> </span>
    

    https://d.pr/i/AHAp

    • This topic was modified 7 years, 7 months ago by neilgee.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jonathandejong

    (@jonathandejong)

    Hi Neil,

    Your code works on my test environment with the latest version of BTF installed.

    
    function modify_dropdown_placeholder( $placeholder, $taxonomy ) {
    	return 'Select from the below';
    }
    add_filter( 'beautiful_filters_dropdown_placeholder', 'modify_dropdown_placeholder', 10, 2 );

    Where are you putting this code?

    Thread Starter neilgee

    (@neilgee)

    Hi Jonathan,

    hmm strange – straight into functions.php – I am using other filters which are working fine – here is a dev url – https://dev.temple.websitelove.com.au/temple-shop/

    Plugin Author Jonathandejong

    (@jonathandejong)

    Other filters for BTF?

    You’re not putting in inside some other hook or function or class (farfetched) inside functions.php?

    Thread Starter neilgee

    (@neilgee)

    Yes other filters for BTF are ok – just placed regularly in functions – here is my BTF filters…

    
    	add_filter( 'beautiful_filters_taxonomy_label', 'modify_btf_dropdown_label', 10, 2 );
    	function modify_btf_dropdown_label( $label, $taxonomy ) {
    
    		return 'Select By Concern';
    	}
    
    	add_filter('beautiful_filters_apply_button', 'modify_filter_button', 10, 1);
    	function modify_filter_button($string){
    
    		return 'Apply Search';
    	}
    
    	add_filter( 'beautiful_filters_dropdown_placeholder', 'modify_dropdown_placeholder', 10, 2 );
    	function modify_dropdown_placeholder( $placeholder, $taxonomy ) {
    
    		return  'Select from the below';
    	}
    

    Top 2 work fine – just the placeholder one is not taking effect

    Plugin Author Jonathandejong

    (@jonathandejong)

    Hi,

    Could you make sure to remove the excess space between return and your string?
    I think that’s causing the blank placeholder ??

    Thread Starter neilgee

    (@neilgee)

    Going back to this issue (wasn’t the spacing) – I think it may be because I am using a taxonomy that is registered to work on the ‘product’ cpt in use by WooCommerce.

    As the code does work in other taxs I have linked to other cpts.

    What do you think?

    Plugin Author Jonathandejong

    (@jonathandejong)

    Hi Neil,

    Yeah unfortunately BTF wont work with WooCommerce due to them writing their own rewrite rules for the products and productcategories.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Placeholder Filter on Dropdown’ is closed to new replies.