Change the label 'Near' and placeholder text 'Location' in the filter bar

Home Forums Calendar Products Filter Bar Change the label 'Near' and placeholder text 'Location' in the filter bar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1172660
    K.
    Participant

    Hi,

    I’m trying to figure out how to change the label ‘Near’ and placeholder text ‘Location’ in the filter bar

    I have followed these instructions:

    Same Title and Placeholder Terms

    which works perfectly for the Search label and placeholder text. So I tried to duplicate and rename the function to get the same result for Location but this doesn’t give me the desired effect.

    — this code is the original snippet which my adjustments

    add_filter( 'tribe-events-bar-filters', 'tribe_support_1043887', 1, 1 );
     
    function tribe_support_1043887( $filters ) {
     
        $value = '';
         
        if ( ! empty( $_REQUEST['tribe-bar-geoloc'] ) ) {
            $value = esc_attr( $_REQUEST['tribe-bar-geoloc'] );
        }
     
        $html = sprintf(
            '<input type="text" name="tribe-bar-geoloc" id="tribe-bar-geoloc" value="%s" placeholder="%s">',
            esc_attr( $value ),
            'Placeholder text'
        );
     
        $filters['tribe-bar-geoloc']['caption'] = 'Label text';
        $filters['tribe-bar-geoloc']['html']    = $html;
     
        return $filters;
    }

    How to go about this? Thanks in advance!

    • This topic was modified 9 years, 7 months ago by K..
    #1173071
    Geoff B.
    Member

    Good evening K. and welcome back!

    Thank you for reaching out to us.

    We are sorry to hear about the adapted snippet not producing the desired results.
    I would love to help you with this topic.

    I will ask the snippet author to see what he says, because your code looks legit to me.

    As an alternative, you coulf probably use Javascript to change your placeholder text.

    Hang in there as I look that up for you.

    Cheers,

    Geoff B.

    #1173402
    Geoff B.
    Member

    Good afternoon K.,

    As promised I had somebody take a look at it.

    It turns out that the priority is too low on it. Just remove the “1,1” priority from the opening filter.

    add_filter( ‘tribe-events-bar-filters’, ‘tribe_support_1043887’);

    Let me know how that goes.

    Best regards,
    Geoff B.

    #1184478
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change the label 'Near' and placeholder text 'Location' in the filter bar’ is closed to new replies.