Support » Plugin: Beautiful taxonomy filters » Change Label or Placeholder?

  • Resolved occreative

    (@occreative)


    I had a contractor build this page, so I know nothing about BTF and how it works. The client has asked to change “Research Categories” to “Search by Category” and “Research Tag” to “Search by Letter” and I have absolutely no idea what to even search for to try and accomplish this. Any help is greatly appreciated. Thank you!

    The page I need help with: [log in to see the link]

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

    (@jonathandejong)

    Hi @occreative

    There’s a filter hook you can use for Placeholders:

    function modify_dropdown_placeholder( $placeholder, $taxonomy ) {
        return 'New placeholder';
    }
    add_filter( 'beautiful_filters_dropdown_placeholder', 'modify_dropdown_placeholder', 10, 2 );

    look at what $taxonomy is and change the output accordingly.
    That should do the trick for you 🙂

    Thread Starter occreative

    (@occreative)

    Thank you for the reply, but I don’t know what any of it means! I can paste that code into my child theme’s functions editor, but as is I know it won’t do what I need. I don’t know annnything about functions stuff and so I don’t even know what “look at what $taxonomy is” even means. I’m so sorry, but any way you can be a little more specific for this noob?

    Plugin Author Jonathandejong

    (@jonathandejong)

    Hi,

    You can put that into the functions editor and then you need to make an if statement and change the values accordingly.

    In your case it should look something like this:

    
    function modify_dropdown_placeholder( $placeholder, $taxonomy ) {
    	switch( $taxonomy ) {
    		case 'research_cats':
    			$placeholder = esc_html__( 'Search by Category' );
    			break;
    		case 'research_tags':
    			$placeholder = esc_html__( 'Search by Letter' );
    			break;
    		default:
    			$placeholder = esc_html__( $placeholder );
    	}
    
    	return $placeholder;
    }
    add_filter( 'beautiful_filters_dropdown_placeholder', 'modify_dropdown_placeholder', 10, 2 );
    

    Best of luck with your project,

    Thread Starter occreative

    (@occreative)

    Thank you!!! It still doesn’t work, but maybe I can figure it out now that I have more specific code to work with. I really appreciate it!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.