function template_include_evento($template_path) { // O conteudo é um post type tgo_evento if (get_post_type() == 'tgo_evento') { if (is_single()) { // Obter o evento // É uma inscrição? if (get_query_var('inscricao') != null) { if ($_GET['cancelar'] != null) { // Cancelando inscrição, validar pessoa na url /* @var $inscricao Inscricao */ $inscricao = Inscricoes::getInstance()->getById($_GET['ticket']); if ($inscricao->id_pessoa != $_GET['cancelar']) { die; } $inscricao->cancelar(); } else { // Chamar wizard da inscrição (outra classe) $etapa = $_POST['etapa']; // Instanciar Wizard $idEvento = get_the_ID(); $ticket = $_GET['ticket']; $wizard = new WizardInscricao($idEvento, $ticket); // var_dump($etapa); if ($etapa != '' && $etapa >= 1) { $evento = get_the_evento(); if ($evento->fb_conversion_track) { add_action('wp_head', 'getEventoFacebookPixel'); } if ($evento->tw_conversion_track) { add_action('wp_head', 'getEventoTwConversionTrack'); } } return PLUGINPATH . '/templates/wizard-inscricao.php'; } } else { if (get_query_var('servico') && get_query_var('ticket') != null) { // Serviço de pagamento externo ControllerInscricoes::direcionarServicoPagamento(get_query_var('servico'), get_query_var('ticket')); return; } else { if (is_avaliacao()) { $template = ControllerQuestionarios::dispatcher('responder'); } else { if (is_certificado()) { ControllerInscricoes::certificado(get_query_var('certificado') / 13); return; } else { if (get_query_var('mobile') != null) { $template = 'mobile.php'; } else { if (get_query_var('aplicarDesconto') != null) { // Chamar form para aplicar desconto $template = 'wizard-desconto.php'; } else { if (get_query_var('set_meio_pagamento') != null) { // Setar meio de pagamento ControllerInscricoes::setMeioPagamento($_SESSION['id_inscricao'], $_GET['set_meio_pagamento']); return; } else { $template = 'single-tgo_evento.php'; } } } } } } } if ($template) { $template_path = templateLocate($template); } if ($template_path == null) { die("Sem template ({$template}) para inclusão."); } } } return $template_path; }