bbPress::register_views()

Register the Forums views

Description

Source

File: bp-forums/classes/class-bbpress.php

    public static function register_views() {

        // Popular discussions
        bbp_register_view(
            'popular',
            __( 'Most popular discussions', 'buddyboss' ),
            apply_filters( 'bbp_register_view_popular', array(
                'meta_key'      => '_bbp_reply_count',
                'max_num_pages' => 1,
                'orderby'       => 'meta_value_num',
                'show_stickies' => false
            )
        ) );

        // Discussions with no replies
        bbp_register_view(
            'no-replies',
            __( 'Discussions with no replies', 'buddyboss' ),
            apply_filters( 'bbp_register_view_no_replies', array(
                'meta_key'      => '_bbp_reply_count',
                'meta_value'    => 1,
                'meta_compare'  => '<',
                'orderby'       => '',
                'show_stickies' => false
            )
        ) );
    }

Changelog

Changelog
Version Description
bbPress (r2789) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.