notifications->countActiveNotifications();
$current_page = ! empty( $_GET['page'] ) ? $_GET['page'] : '';
$is_single_view = (bool) apply_filters( 'edd_admin_is_single_view', ! empty( $_GET['view'] ) );
$page_title = __( 'Downloads', 'easy-digital-downloads' );
switch( $current_page ) {
case 'edd-settings':
$page_title = __( 'Settings', 'easy-digital-downloads' );
break;
case 'edd-reports':
$page_title = __( 'Reports', 'easy-digital-downloads' );
break;
case 'edd-payment-history':
$page_title = __( 'Orders', 'easy-digital-downloads' );
break;
case 'edd-discounts':
$page_title = __( 'Discounts', 'easy-digital-downloads' );
break;
case 'edd-customers':
$page_title = __( 'Customers', 'easy-digital-downloads' );
break;
case 'edd-tools':
$page_title = __( 'Tools', 'easy-digital-downloads' );
break;
case 'edd-addons':
$page_title = __( 'View Extensions', 'easy-digital-downloads' );
if ( edd_is_pro() ) {
$page_title = __( 'Manage Extensions', 'easy-digital-downloads' );
}
break;
default:
if ( ! empty( $_GET['page'] ) ) {
$page_title = ucfirst( str_replace( array( 'edd-', 'fes-' ), '', $current_page ) );
} elseif ( ! empty( $_GET['post_type'] ) ) {
$post_type = get_post_type_object( $_GET['post_type'] );
$page_title = $post_type->labels->name;
}
break;
}
$page_title = apply_filters( 'edd_settings_page_title', $page_title, $current_page, $is_single_view );
if ( ! empty( $page_title ) && empty( $is_single_view ) ) {
?>
__( 'General', 'easy-digital-downloads' )
);
}
// Default links array
$links = array();
// Loop through sections
foreach ( $sections as $section_id => $section_name ) {
// Tab & Section
$tab_url = add_query_arg(
array(
'post_type' => 'download',
'page' => 'edd-settings',
'tab' => $active_tab,
'section' => $section_id,
),
edd_get_admin_base_url()
);
// Settings not updated
$tab_url = remove_query_arg( 'settings-updated', $tab_url );
// Class for link
$class = ( $section === $section_id )
? 'current'
: '';
// Add to links array
$links[ $section_id ] = '' . esc_html( $section_name ) . '';
}
if ( count( $links ) < 2 ) {
return;
}
?>
$stitle ) {
if ( is_string( $sid ) && ! empty( $sections ) && array_key_exists( $sid, $sections ) ) {
continue;
} else {
$has_main_settings = true;
break;
}
}
}
// Unset 'main' if it's empty and default to the first non-empty if it's the chosen section.
if ( false === $has_main_settings ) {
unset( $sections['main'] );
if ( 'main' === $section ) {
foreach ( $sections as $section_key => $section_title ) {
if ( ! empty( $all_settings[ $active_tab ][ $section_key ] ) ) {
$section = $section_key;
$override = true;
break;
}
}
}
}
// Start a buffer
ob_start(); ?>