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

    (@gwin)

    Hi, you can change it by modifying the Search form structure.

    add_filter( 'adverts_form_load', 'custom_placeholder' );
    function custom_placeholder( $form ) {
    
        if( $form['name'] != 'search' ) {
            return $form;
        }
    
        foreach( $form["field"] as $key => $field ) {
            if( $field["name"] == "query" ) {
                $form["field"][$key]["attr"]["placeholder"] = "New Placeholder";
            }
    
        }
    
        return $form;
    }
    Thread Starter Eve

    (@etransac)

    thanks Greg works great!

    Thread Starter Eve

    (@etransac)

    Hi Greg,

    I cannot edit/change the placeholder for custom search category filter.. can pls help me. thanks!

    Plugin Author Greg Winiarski

    (@gwin)

    Hi, for dropdown fields you can set placeholder by setting ’empty_option_text’ param, so in the code instead of

    if( $field["name"] == "query" ) {
                $form["field"][$key]["attr"]["placeholder"] = "New Placeholder";
            }

    you will have

    if( $field["name"] == "query" ) {
                $form["field"][$key]["empty_option_text"] = "New Placeholder";
            }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change Search Bar Placeholder’ is closed to new replies.