Deprecated

This method has been deprecated.

Notifications::ap_menu_items( object $items )

Description #

Filter notification menu title.

Parameters #

  • $items
    object (Required) Menu item object.

Changelog #

VersionDescription
4.1.2Introduced.

Source #

File: addons/notifications/notifications.php

	public function ap_menu_items( $items ) {
		foreach ( $items as $k => $i ) {
			if ( isset( $i->post_name ) && 'notifications' === $i->post_name ) {
				$count = ap_count_unseen_notifications();
				if ( $count > 0 ) {
					$items[ $k ]->title = $i->title . '<i class="noti-count">' . esc_attr( number_format_i18n( $count ) ) . '</i>';
				}
			}
		}

		return $items;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment