| 1 |
<?php |
| 2 |
/** |
| 3 |
* @var \FilterEverything\Filter\TabInterface[] $tabs |
| 4 |
*/ |
| 5 |
|
| 6 |
if ( ! defined('ABSPATH') ) { |
| 7 |
exit; |
| 8 |
} |
| 9 |
|
| 10 |
?> |
| 11 |
<div class="wrap"> |
| 12 |
<h1><?php esc_html_e( 'Filters Settings', 'filter-everything' ) ?></h1> |
| 13 |
<h2 class="nav-tab-wrapper"> |
| 14 |
<?php foreach ( $tabs as $tab ): ?> |
| 15 |
<?php if ( $tab->valid() ): ?> |
| 16 |
<?php |
| 17 |
$class = ( $tab == $current ) ? ' nav-tab-active' : ''; |
| 18 |
$class .= ' wpc-tab-' . $tab->getName(); |
| 19 |
$tabUrl = admin_url( 'edit.php?post_type=filter-set&page=filters-settings&tab=' . $tab->getName() ); |
| 20 |
$label = esc_html($tab->getLabel()); |
| 21 |
?> |
| 22 |
<a class='nav-tab<?php echo esc_attr( $class ); ?>' |
| 23 |
href='<?php echo esc_url( $tabUrl ); ?>'><?php echo $label ?> |
| 24 |
<?php if (method_exists($tab, 'labelIcon')) { |
| 25 |
echo '<span class="' . esc_attr('wpc-nav-tab-icon') . '">' .$tab->labelIcon() . '</span>'; |
| 26 |
}?> |
| 27 |
</a> |
| 28 |
<?php |
| 29 |
if (method_exists($tab, 'getFreeLink')) { |
| 30 |
$links = $tab->getFreeLink(); |
| 31 |
if (!empty($links)) { |
| 32 |
$tabUrl = $links['link']; |
| 33 |
$label = $links['text']; ?> |
| 34 |
<a class='nav-tab<?php echo esc_attr(' wpc-tab-' . $tab->getName()); ?> wpc-pro-badge-text' |
| 35 |
href='<?php echo esc_url($tabUrl); ?>'><?php echo $label ?></a> |
| 36 |
<?php } |
| 37 |
} |
| 38 |
?> |
| 39 |
<?php endif; ?> |
| 40 |
<?php endforeach; ?> |
| 41 |
</h2> |
| 42 |
<?php echo $current->render() //already escaped in the method ?> |
| 43 |
</div> |