By default, the HTML code is stripped out. But even when I directly modified the safeOutput function in shortcode.php I still could not get HTML to be rendered; instead the actual HTML code was rendered in plain text.
Thank you for your help and the code. I am able to render custom data in the pop up, but I still cannot render it as HTML.
Below the code renders the link HTML as text HTML characters instead of the link itself:
<?php // Step 1, add the required custom field data to the event array so that it's available in the Pie Calendar JavaScript. add_filter('piecal_event_array_filter', function( $event ) { if( !get_the_ID() ) { return $event; }
// Get custom field data and assign it to the event array $event['event_information'] = 'This is a <a ; //get_field('event_information'); return $event; }, 10, 4);
// Step 2, make sure this data is passed to the calendarEngine object on event click so it can be output in the popover. // Properties added this way are always located under info.event._def.extendedProps add_action('piecal_additional_event_click_js', function() { ?> Alpine.store("calendarEngine").event_information = info.event._def.extendedProps.event_information; <?php }, 10, 0);
// Step 3, output the data in the popover using Alpine function my_inject_custom_field_in_popover( $atts ) { // Note: $atts is available so you can check for shortcode attributes before making modificats, e.g. make sure showcustomfields=true. ob_start(); ?> <p class="piecal_popover_custom_field" x-show="$store.calendarEngine.event_information" x-text="'Event Information: ' + $store.calendarEngine.event_information"></p> <?php echo ob_get_clean(); }