I don't want to modify core plugin code. Is it possible?

Home Forums Calendar Products Events Calendar PRO I don't want to modify core plugin code. Is it possible?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #954681
    VLADIMIR
    Participant

    the-events-calendar/lib/the-events-calendar.class.php
    ‘caption’ => __( ‘Search’, ‘tribe-events-calendar’ ),
    ‘html’ => ‘<input type=”text” name=”tribe-bar-search” id=”tribe-bar-search” value=”‘ . $value . ‘” placeholder=”‘ . __( ‘Search’, ‘tribe-events-calendar’ ) . ‘”>’

    How to make distinguished these two words: caption “Search” and placeholder “Search” ?

    Search by keyword
    Enter a keyword here

    I don’t want to modify core plugin code.
    Is it possible to do this with a copy of the file in a directory mychildtheme/tribe-events/?

    #954739
    Gustavo Bordoni
    Keymaster

    Hi Vladimir,

    Thanks for reaching out to us here on our support forum.

    So what you should look at a filter: ‘tribe-events-bar-filters’

    You will need to remove the current field then add new one.

    		if ( class_exists( 'Tribe__Events__Events' ) ){
    			$instances['tec'] = Tribe__Events__Events::instance();
    		} else {
    			$instances['tec'] = TribeEvents::instance();
    		}
    
    		remove_filter( 'tribe-events-bar-filters', array( $instances['tec'], 'setup_keyword_search_in_bar' ), 1, 1 );
    		add_filter( 'tribe-events-bar-filters', 'new_field_function_filters', 10, 1 );
    

    If there is any questions feel free to ask, but this will require development knowledge.

    My Best Regards,

    #954763
    VLADIMIR
    Participant

    I don’t want to remove or change current fields.
    I don’t want to change filter’s functionality.
    We are talking about the difference between caption and a placeholder instead of a single word “Search”

    #954821
    Gustavo Bordoni
    Keymaster

    Right Vladimir,

    On this case you cannot change only the Placeholder and the Caption, you will need to overwrite the whole field. What I mean is, remove the old one and replace with yours, same functionality only changing the Caption and Placeholder.

    My Best Regards,

    #954834
    VLADIMIR
    Participant

    ok

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘I don't want to modify core plugin code. Is it possible?’ is closed to new replies.