function historial_cuenta() { global $current_user; if (!is_user_logged_in()) { return; } $reserva = get_posts(array('posts_per_page' => -1, 'post_type' => array('reserva', 'pedido'), 'author' => $current_user->ID, 'post_status' => array('future', 'publish'))); if (!$reserva) { return; } echo '<div class="columna_general">'; echo '<div class="historial">'; foreach ($reserva as $clase) { if ($clase->post_type === 'reserva') { $c = new Reserva($clase->ID); if ($clase->post_status == 'future') { $c->print_historial(true); } else { $c->print_historial(false); } } else { $c = new Pedido($clase->ID); $c->print_historial(); } } echo '</div>'; echo '</div>'; }