• Resolved riccardoplz

    (@riccardoplz)


    Good morning, I wanted to replace the terms of taxonomies that appear in the filter’s placeholder.

    I’ve tried using your feature that you include in API:

    $placeholder = ‘paese’;
    $taxonomy = ‘tipologia_immobile’;

    function modify_categories_dropdown( $placeholder=’paese’, $taxonomy=’tipologia_immobile’ ) {

    return ‘New placeholder’;
    }
    add_filter( ‘beautiful_filters_dropdown_placeholder’, ‘modify_dropdown_placeholder’, 10, 2 );

    It does not work and it returns the following error:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘modify_dropdown_placeholder’ not found or invalid function name in /home/andreaf3/public_html/wp-includes/class-wp-hook.php on line 298

    What’s the problem?
    thank you,
    Riccardo

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jonathandejong

    (@jonathandejong)

    Hi Riccardo,

    Your filter function hook and the actual function name is different. Try this instead:

    
    function modify_dropdown_placeholder( $placeholder, $taxonomy ) {
    	if ( 'tipologia_immobile' == $taxonomy ) {
    		return 'paese';
    	}
    	return $placeholder;
    }
    add_filter( 'beautiful_filters_dropdown_placeholder', 'modify_dropdown_placeholder', 10, 2 );
    

    Also please note that you need select2 active for a placeholder to work.

    Thread Starter riccardoplz

    (@riccardoplz)

    Thank you very much!

    Riccardo

    Plugin Author Jonathandejong

    (@jonathandejong)

    No problem!
    If you enjoy BTF please leave a review 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘API / modify_dropdown_placeholder don’t work’ is closed to new replies.