Parse error when trying to set plugin to use eventbrite.co.uk

Home Forums Ticket Products Eventbrite Tickets Parse error when trying to set plugin to use eventbrite.co.uk

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1184854
    Nelson Ferryman
    Participant

    I’m following the “Configuring Eventbrite Tickets to use eventbrite.co.uk” knowledgebase article, but no matter where I paste the supplied code I get a parse error originating from the child functions.php and on whatever line I’ve pasted the code, such as:

    Parse error: syntax error, unexpected ‘{‘ in C:\xampp\htdocs\cgf_event\wp-content\themes\sketch-child\functions.php on line 14

    I have no idea what the problem is… child theme functions.php attached.

    #1184855
    Nelson Ferryman
    Participant

    functions.php did not attach, will paste below:

    <?php
    function my_theme_enqueue_styles() {
    
        $parent_style = 'sketch-style'; 
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    
    if ( ! function_exists( 'tribe_support_use_co_uk_eb' ) { 
        /**
         * Using eventbrite.co.uk for Eventbrite Tickets
         */
        function tribe_support_use_co_uk_eb( $url ) {
            return str_replace( '.com', '.co.uk', $url );
        }
    }
    
    add_filter( 'tribe-eventbrite-base_api_url', 'tribe_support_use_co_uk_eb' );
    ?>
    
    
    #1185376
    George
    Participant

    Thanks for reaching out, Nelson. A few tips:

    1. Remove the ?> at the end of the file

    2. Change this:

    if ( ! function_exists( 'tribe_support_use_co_uk_eb' ) {

    To this:

    if ( ! function_exists( 'tribe_support_use_co_uk_eb' ) ) {

    3. Put the add_filter( 'tribe-eventbrite-base_api_url', 'tribe_support_use_co_uk_eb' ); inside the curly bracket right above it. So instead of this:


    }

    add_filter( 'tribe-eventbrite-base_api_url', 'tribe_support_use_co_uk_eb' );

    It’s like this:


    add_filter( 'tribe-eventbrite-base_api_url', 'tribe_support_use_co_uk_eb' );
    }

    I hope this all helps! 😀 Apologies if the code in the article itself is wrong, we will fix this if so.

    — George

    #1195856
    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 ‘Parse error when trying to set plugin to use eventbrite.co.uk’ is closed to new replies.