diff --git a/classes/helpers/FrmEntriesHelper.php b/classes/helpers/FrmEntriesHelper.php index 55ae5764e2..4d8341bec3 100644 --- a/classes/helpers/FrmEntriesHelper.php +++ b/classes/helpers/FrmEntriesHelper.php @@ -878,17 +878,20 @@ public static function get_visible_unread_inbox_count() { return 0; } - if ( FrmAppHelper::pro_is_installed() && is_callable( 'FrmProAppHelper::get_settings' ) ) { - $settings = FrmProAppHelper::get_settings(); - $inbox_badge_off = ! empty( $settings->inbox ) && ! isset( $settings->inbox['badge'] ); + $inbox = new FrmInbox(); + $inbox_count = count( $inbox->unread() ); - if ( $inbox_badge_off ) { - // When the badge is disabled, the unread count is not included in the menu name. + if ( ! $inbox_count ) { + return 0; + } + + if ( is_callable( 'FrmProSettingsController::inbox_badge' ) ) { + $inbox_count = FrmProSettingsController::inbox_badge( $inbox_count ); + if ( ! $inbox_count ) { return 0; } } - $inbox = new FrmInbox(); - return count( $inbox->unread() ); + return $inbox_count; } } diff --git a/stubs.php b/stubs.php index bce0038996..b82cfde206 100644 --- a/stubs.php +++ b/stubs.php @@ -416,6 +416,14 @@ class FrmTransListsController { public static function payment_columns( $columns = array() ) { } } + class FrmProSettingsController { + /** + * @param string $count + * @return string + */ + public static function inbox_badge( $count ) { + } + } } namespace Elementor {