Deprecated
This function has been deprecated.
ap_options_nav()
Description #
Output option tab nav.
Source #
File: includes/deprecated.php
function ap_options_nav() {
_deprecated_function( __FUNCTION__, '4.1.0' );
$groups = ap_get_option_groups();
$active = ap_sanitize_unslash( 'option_page', 'p' ) ? ap_sanitize_unslash( 'option_page', 'p' ) : 'general';
$menus = array();
$icons = array(
'general' => 'apicon-home',
'layout' => 'apicon-eye',
'pages' => 'apicon-pin',
'question' => 'apicon-question',
'users' => 'apicon-users',
'permission' => 'apicon-lock',
'moderate' => 'apicon-flag',
'roles' => 'apicon-user',
'categories' => 'apicon-category',
'tags' => 'apicon-tag',
'labels' => 'apicon-tag',
);
foreach ( (array) $groups as $k => $args ) {
$link = admin_url( "admin.php?page=anspress_options&option_page={$k}" );
$icon = isset( $icons[ $k ] ) ? esc_attr( $icons[ $k ] ) : 'apicon-gear';
$menus[ $k ] = array(
'title' => $args['title'],
'link' => $link,
'icon' => $icon,
);
}
/**
* Filter is applied before showing option tab navigation.
*
* @var array
* @since 2.0.0
*/
$menus = apply_filters( 'ap_option_tab_nav', $menus );
$o = '<h2 class="nav-tab-wrapper">';
foreach ( (array) $menus as $k => $m ) {
$class = ! empty( $m['class'] ) ? ' ' . $m['class'] : '';
$o .= '<a href="' . esc_url( $m['link'] ) . '" class="nav-tab ap-user-menu-' . esc_attr( $k . $class ) . ( $active === $k ? ' nav-tab-active' : '' ) . '"><i class="' . $m['icon'] . '"></i>' . esc_attr( $m['title'] ) . '</a>';
}
$o .= '</h2>';
echo $o; // xss okay.
}
Expand full source code Collapse full source code View on GitHub: includes/deprecated.php:765
Add your comment