P2020_FILTER_COUNT_LIMIT ) { return P2020_FILTER_COUNT_LIMIT . '+'; } return $count; } function print_filter_controls() { if ( ! is_user_logged_in() || is_search() || ( is_404() && ! P2_Core\Filtering\View::get_active_filter() ) || is_tag() || is_category() ) { return; } $filters = P2_Core\Filtering\View::get_links( true ); // Add "All" filter. $filters = array_merge( [ 'all' => [ 'label' => _x( 'All', 'all posts', 'p2020' ), 'url' => home_url(), 'unread_count' => 0, ], ], $filters ); // Check if there is at least one unread item. $menu_class = ! empty( array_filter( array_column( $filters, 'unread_count' ) ) ) ? 'has-counters' : ''; ?>