Helper: Don't display (0) in top navigation when no updates available.

This commit is contained in:
Konstantin Kovshenin 2017-08-28 10:32:51 +03:00
parent 0cafd1a499
commit 578f25ebdc
2 changed files with 8 additions and 0 deletions

View File

@ -6,6 +6,10 @@
<?php
$count = WC_Helper_Updater::get_updates_count();
$count_html = sprintf( '<span class="update-plugins count-%d"><span class="update-count">(%d)</span></span>', $count, number_format_i18n( $count ) );
if ( ! $count ) {
$count_html = '';
}
$menu_title = sprintf( __( 'WooCommerce.com Subscriptions %s', 'woocommerce' ), $count_html );
?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons&section=helper' ) ); ?>" class="nav-tab nav-tab-active"><?php echo $menu_title; ?></a>

View File

@ -17,6 +17,10 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$count = WC_Helper_Updater::get_updates_count();
$count_html = sprintf( '<span class="update-plugins count-%d"><span class="update-count">(%d)</span></span>', $count, number_format_i18n( $count ) );
if ( ! $count ) {
$count_html = '';
}
$menu_title = sprintf( __( 'WooCommerce.com Subscriptions %s', 'woocommerce' ), $count_html );
?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons&section=helper' ) ); ?>" class="nav-tab"><?php echo $menu_title; ?></a>