Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion classes/helpers/FrmEntriesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ public static function get_visible_unread_inbox_count() {
}

$inbox = new FrmInbox();
$inbox_count = count( $inbox->unread() );
$inbox_count = $inbox->get_unread_count();

if ( ! $inbox_count ) {
return 0;
Expand Down
13 changes: 12 additions & 1 deletion classes/models/FrmInbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function unread() {
* @return string
*/
public function unread_html( $filtered = true ) {
$count = count( $this->unread() );
$count = $this->get_unread_count();
if ( ! $count ) {
return '';
}
Expand All @@ -334,6 +334,17 @@ public function unread_html( $filtered = true ) {
return (string) apply_filters( 'frm_inbox_badge', $html );
}

/**
* Get unread inbox count.
*
* @since x.x
*
* @return int
*/
public function get_unread_count() {
return count( $this->unread() );
}

/**
* @since 4.05.02
*
Expand Down
Loading