Regarding Featured Image

Home Forums Ticket Products Eventbrite Tickets Regarding Featured Image

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #946241
    Ian Garlic
    Participant

    Hello,

    I am really enjoying the events calendar. It functions without any problems both on import and export of events from eventbrite. However, one of my clients will be working with events on both eventbrite and wordpress. He creates the event in eventbrite and adds the featured image through eventbrite which then shows up on the right side of the eventbrite page.

    The issue is that when we import the event into wordpress we need to add a featured image to show up as a thumbnail for the event. On updating the page the image we set in wordpress is pushed to eventbrite in a custom header as html code. This is bad because the image is often blown out of proportion or not needed. How can I disable the ability to export WordPress’s featured image to eventbrite? Any advice would be very appreciated.

    #946366
    Barry
    Member

    Hi Ian,

    I believe the following short snippet (which you might for instance add to your theme’s functions.php file) should do the trick:

    add_filter( 'tribe_events_eb_request', 'kill_sending_img_to_eb' );
    
    function kill_sending_img_to_eb( $request ) {
    	$start = strpos( $request, 'custom_header' );
    	if ( false === $start ) return $request;
    	$end = strpos( $request, '&', $start );
    	return substr_replace( $request, '', $start, ++$end - $start );
    }

    It’s fairly crude and you could potentially refine things, but why not give it a try and see if it fits the bill?

    #946966
    Ian Garlic
    Participant

    Barry,

    I tried placing the code you provided into my functions.php file but the featured image from WordPress is still being placed in Eventbrite’s custom head section. Any other ideas would be greatly appreciated.

    Thanks

    #946987
    Barry
    Member

    Hi Ian,

    Apologies there, can you try this revised version:

    add_filter( 'tribe_events_eb_request', 'kill_sending_img_to_eb' );
    
    function kill_sending_img_to_eb( $request ) {
    	$start = strpos( $request, 'custom_header' );
    	if ( false === $start ) return $request;
    
    	// $end may be false if the custom header value is the last part of the URL query
    	$end = strpos( $request, '&', $start );
    	$len = ( false === $end ) ? strlen( $request ) - $start + 1 : ++$end - $start;
    
    	// Remove the custom header key/value from the query
    	return trim( substr_replace( $request, '', $start, $len ), '&' );
    }

    I hope that helps!

    #947016
    Ian Garlic
    Participant

    Worked like a charm. You guys are awesome, thanks!

    #947076
    Barry
    Member

    Our pleasure, and apologies for the hiccup along the way 🙂

    I’ll go ahead and close out this topic, but if we can assist with any other issues please don’t hesitate to post new threads as needed.

    Thanks again!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Regarding Featured Image’ is closed to new replies.