Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/8959451 to your computer and use it in GitHub Desktop.
Save joshfeck/8959451 to your computer and use it in GitHub Desktop.
update the price option correctly
<?php
if (!function_exists('espresso_ticket_information')) {
function espresso_ticket_information($atts) {
global $wpdb;
extract($atts);
$price_option = "{$price_option}";
$type = "{$type}";
switch ($type) {
case 'ticket':
default:
$sql = $wpdb->get_results("SELECT * FROM " . EVENTS_PRICES_TABLE . " WHERE id ='" . $price_option . "'");
$num_rows = $wpdb->num_rows;
if ($num_rows > 0) {
if (function_exists('espresso_members_installed') && is_user_logged_in()==true) {
return $wpdb->last_result[0]->member_price_type;
}else{
return $wpdb->last_result[0]->price_type;
}
}
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment