Skip to content

Instantly share code, notes, and snippets.

@alanef
Last active March 28, 2023 19:22
Show Gist options
  • Select an option

  • Save alanef/225c2669e38cfaa076b674b09b3a7d32 to your computer and use it in GitHub Desktop.

Select an option

Save alanef/225c2669e38cfaa076b674b09b3a7d32 to your computer and use it in GitHub Desktop.
Coston Display Eventbrite Calendar Add ImaCustom Display Eventbrite - alter the events, add images
<?php
/*
* Plugin Name: Display Eventbrite Events - Custom Calendar add image
* Plugin URI: https://fullworksplugins.com/
* Description: Add extra javascript to events so the image is loaded in the calendar
*
*/
add_filter( 'wfea_cal_extra_js', function ( $script, $args ) {
$script =
'
if ( typeof wfea_cal_extra_javascript == \'undefined\' ) {
var wfea_cal_extra_javascript = {
eventRender: function (event, element) {
let img = \'\';
if (event.imageurl) {
img = \'<img class="wfea-fc-img" src="\'+event.imageurl+\'" alt="\'+event.title+\'" />\';
// prepend img to .fc-content
element.find(\'.fc-content\').prepend(img);
}
}
}
}
';
return $script;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment