Exemple #1
0
function lg_hub_endpoints()
{
    foreach (lg_hub_tab_list() as $key => $tab) {
        if ($key === 0) {
            continue;
        }
        add_rewrite_endpoint($tab, EP_PAGES);
    }
}
Exemple #2
0
function hub_tabs()
{
    if (is_hub('single')) {
        ?>
	<div id="hub-tabs">
		<ul>
			<?php 
        foreach (lg_hub_tab_list() as $key => $tab) {
            $class = null;
            if (get_endpoint($tab) || $key == 0 && get_current_url() == get_permalink()) {
                $class = 'current-tab';
            }
            // if(is_hub()) $class = 'current-tab';
            $end = $key > 0 ? $tab : null;
            ?>
				<li class="hub-tab-item <?php 
            echo $class;
            ?>
"><a href="<?php 
            echo get_the_permalink() . $end;
            ?>
"><?php 
            echo strpretty($tab);
            ?>
</a></li>
			<?php 
        }
        ?>
		</ul>
	</div>
<?php 
    }
}