$candidates = Foruns::get_candidates($uf, $setorial); $forum_uf_setorial = strtoupper($uf) . '-' . $setorial; $original_post = $post; $current_user_ID = get_current_user_id(); ?> <header> <div class="section-description"> <!-- <p>Olá <strong><?php echo user_short_name(); ?> !</strong> Este é o fórum de debates do Setorial de <strong><?php echo substr($post->post_title, 4); ?> </strong>do estado <strong><?php echo get_state_name_by_uf(substr($post->post_title, 0, 2)); ?> </strong>.</p> --> <?php if (is_user_this_uf_setorial($post->post_name)) { ?> <p><?php echo nl2br(get_theme_option('txt_forum_is_voter')); ?> </p> <?php } else { ?> <p><?php echo nl2br(get_theme_option('txt_forum_is_not_voter')); ?>
function show_text_state_by_uf($uf) { $uf = strtoupper($uf); switch ($uf) { case 'BA': case 'PB': $text = 'da'; break; case 'AL': case 'GO': case 'MT': case 'MS': case 'MG': case 'PE': case 'RO': case 'RR': case 'SC': case 'SP': case 'SE': $text = 'de'; break; case 'AP': case 'AM': case 'CE': case 'DF': case 'ES': case 'MA': case 'PA': case 'PR': case 'PI': case 'RJ': case 'RN': case 'RS': case 'TO': $text = 'do'; break; default: $text = 'do'; } return $text . ' ' . get_state_name_by_uf($uf) . ' (' . $uf . ')'; }