diff --git a/classes/helpers/FrmEntriesHelper.php b/classes/helpers/FrmEntriesHelper.php index 4d8341bec3..f3a77972da 100644 --- a/classes/helpers/FrmEntriesHelper.php +++ b/classes/helpers/FrmEntriesHelper.php @@ -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; diff --git a/classes/models/FrmInbox.php b/classes/models/FrmInbox.php index 3ddc313c1f..acdc70f21d 100644 --- a/classes/models/FrmInbox.php +++ b/classes/models/FrmInbox.php @@ -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 ''; } @@ -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 *