Ben Jones Ben Jones - 3 months ago 21
PHP Question

Wordpress PHP plugin code

Hi I need help with modifying the below PHP. Essentially I need to insert a separator in the output between $time & $Venue and turn the venue into a Hyperlink with a fixed URL.

Ben

if ( ! function_exists( 'TCG_eventbrite_event_meta' ) ) :
function TCG_eventbrite_event_meta() {
// Determine our separator.
$separator = apply_filters( 'eventbrite_meta_separator', '<span class="sep"> &middot; </span>' );
// Start our HTML output with the event time.
$time = '<span class="event-time">' . eventbrite_event_time() . '</span>';
// Add a venue name if available.
$venue = '<span class="event-venue">' . eventbrite_event_venue()->name . '</span>';
// Assemble our HTML. Yugly.
$html = sprintf( _x( '%1$s%2$s', '%1$s: time, %2$s: venue', 'eventbrite-api' ),
$time,
$venue
);
echo apply_filters( 'eventbrite_event_meta', $html, $time, $venue );
}
endif;

Answer

Fastest soultion is this:

$venue = ' | <span class="event-venue"><a href="http//staticlink.com" target="_blank">' . eventbrite_event_venue()->name . '</a></span>';