WPSEO_Admin_Bar_Menu::get_notification_counter
Gets the notification counter if in a valid context.
Метод класса: WPSEO_Admin_Bar_Menu{}
Хуков нет.
Возвращает
Строку. Notification counter markup, or empty string if not available.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_notification_counter( $notification_count );
- $notification_count(int) (обязательный)
- Number of notifications.
Код WPSEO_Admin_Bar_Menu::get_notification_counter() WPSEO Admin Bar Menu::get notification counter Yoast 27.7
protected function get_notification_counter( $notification_count ) {
/* translators: Hidden accessibility text; %s: number of notifications. */
$counter_screen_reader_text = sprintf( _n( '%s notification', '%s notifications', $notification_count, 'wordpress-seo' ), number_format_i18n( $notification_count ) );
return sprintf(
' <div class="wp-core-ui wp-ui-notification yoast-issue-counter%s"><span class="yoast-issues-count" aria-hidden="true">%d</span><span class="screen-reader-text">%s</span></div>',
( $notification_count ) ? '' : ' wpseo-no-adminbar-notifications',
$notification_count,
$counter_screen_reader_text,
);
}