NULL, ), $atts)); if (!$id){ $shortcodeContent = "

You need to provide a show ID to the show shortcode to display a show.

"; }else{ $showID = esc_html($id); $show_meta_data = get_post_custom($showID); $showDate = esc_html( get_post_meta($showID, 'artistpress_show_date', true) ); $showTime = esc_html( get_post_meta($showID, 'artistpress_show_time', true) ); $showType = esc_html( get_post_meta($showID, 'artistpress_show_type', true) ); $showPrice = esc_html( get_post_meta($showID, 'artistpress_show_price', true) ); $showTicketPhone = esc_html( get_post_meta($showID, 'artistpress_ticket_phone', true) ); $showTicketWeb = esc_html( get_post_meta($showID, 'artistpress_ticket_url', true) ); $showAdditionalInfo = esc_html( get_post_meta($showID, 'artistpress_show_add_info', true) ); $artistID = unserialize($show_meta_data['artistpress_show_artist'][0]); $artistID = $artistID[0]; $artistName = esc_html( get_the_title($artistID) ); $artistPermalink = get_the_permalink($artistID); $venueID = unserialize($show_meta_data['artistpress_show_venue'][0]); $venueID = $venueID[0]; $venueName = esc_html( get_the_title($venueID) ); $venueStreet = esc_html( get_post_meta($venueID, 'artistpress_venue_address', true)); $venueCity = esc_html( get_post_meta($venueID, 'artistpress_venue_city', true)); $venueState = esc_html( get_post_meta($venueID, 'artistpress_venue_state', true)); $venuePostal = esc_html( get_post_meta($venueID, 'artistpress_venue_postal_code', true)); $venueCountry = esc_html( get_post_meta($venueID, 'artistpress_venue_country', true)); $venueWebsite = esc_html( get_post_meta($venueID, 'artistpress_venue_website', true)); $venueAddress = $venueStreet . '
' . $venueCity . ', ' . $venueState . ' ' . $venuePostal; $artistpress_venue_latlng = esc_html( get_post_meta($venueID, 'artistpress_venue_latlng', true)); $artistpress_venue_latlng = substr($artistpress_venue_latlng, 1, -1); $venuePhone = esc_html( get_post_meta($venueID, 'artistpress_venue_telephone', true)); $startLatLng = null; $endLatLng = $artistpress_venue_latlng; if( $showType == 'not-sure' ) { $showType = 'Not Sure'; } elseif( $showType == 'all-ages' ) { $showType = 'All Ages'; } elseif( $showType == 'all-ages-licensed' ) { $showType = 'All Ages Licensed'; } elseif( $showType == 'no-minors' ) { $showType = 'No Minors'; } if ($showTicketWeb != NULL){ //removes the turminating slash off of URL $showTicketWeb = trim($showTicketWeb, '/'); if (!preg_match('#^http(s)?://#', $showTicketWeb)) { // If scheme not included, prepend it $showTicketWeb = 'http://' . $showTicketWeb; } } if ($venueWebsite != NULL){ //removes the turminaing slash off of URL $venueWebsite = trim($venueWebsite, '/'); if (!preg_match('#^http(s)?://#', $venueWebsite)) { // If scheme not included, prepend it $venueWebsite = 'http://' . $venueWebsite ; } } //Show Details $shortcodeContent = '
'; $shortcodeContent .= '

' . $artistName . '

'; $shortcodeContent .= '
'; $shortcodeContent .= '
'; $shortcodeContent .= get_the_post_thumbnail($showID); $shortcodeContent .= '
'; $shortcodeContent .= '
'; $shortcodeContent .= '
'; //Show Details $shortcodeContent .= '
'; $shortcodeContent .= '

Show Details

'; $shortcodeContent .= '
    '; if ( ( $showDisplayDate == 'yes' ) && ( $showDate != NULL) ){ $shortcodeContent .= '
  • Date: ' . $showDate . '
  • '; } if ( ( $showDisplayTime == 'yes' ) && ( $showTime != NULL) ){ $shortcodeContent .= '
  • Time: ' . $showTime . '
  • '; } if ( ( $showDisplayType == 'yes' ) && ( $showType != NULL) ){ $shortcodeContent .= '
  • Show Type: ' . $showType . '
  • '; } if ( ( $showDisplayPrice == 'yes' ) && ( $showPrice != NULL) ){ $shortcodeContent .= '
  • Admission: ' . $showPrice . '
  • '; } if ( ( $showDisplayTicketPhone == 'yes' ) && ( $showTicketPhone != NULL) ){ $shortcodeContent .= '
  • Phone: ' . $showTicketPhone . '
  • '; } $shortcodeContent .= '
'; if ( $showDisplayTicketButton == 'yes' ){ if ( $showTicketButLabel == !NULL) { $shortcodeContent .= ''. $showTicketButLabel .''; }else{ $shortcodeContent .= 'Get Tickets'; } } $shortcodeContent .= '
'; //Venue Details $shortcodeContent .= '
'; $shortcodeContent .= '

' . $venueName . '

'; $shortcodeContent .= '
    '; if (( $showDisplayVenueAddress == 'yes' ) && ( $venueAddress != NULL ) ){ $shortcodeContent .= '
  • ' . $venueAddress . '
  • '; } if (( $showDisplayVenuePhone == 'yes' ) && ( $venuePhone != NULL ) ){ $shortcodeContent .= '
  • Venue Phone: ' . $venuePhone . '
  • '; } $shortcodeContent .= '
'; if ($venueWebsite != NULL){ $shortcodeContent .= 'Venue Website'; } $shortcodeContent .= '
'; //Additional Info if ($showDisplayInfo == 'yes'){ $shortcodeContent .= '
'; $shortcodeContent .= '
'; if ($showAdditionalInfo != NULL){ $shortcodeContent .= '

Additional Info:

'; $shortcodeContent .= '' . $showAdditionalInfo . ''; } $shortcodeContent .= '
'; $shortcodeContent .= '
'; } $shortcodeContent .= '
'; $shortcodeContent .= '
'; // Map Section $shortcodeContent .= '
'; if ( $showDisplayMap == 'yes' ){ $shortcodeContent .= '
'; $shortcodeContent .= '
'; $shortcodeContent .= ''; $shortcodeContent .= '
'; $shortcodeContent .= '
'; if ( $showDisplayDirections == 'no' ){ $shortcodeContent .= ''; $shortcodeContent .= '
'; $shortcodeContent .= '
'; } return $shortcodeContent; }