BuddyDev

Search

[Resolved] BBpress Views Function

  • Participant
    Level: Enlightened
    Posts: 104
    Erich199 on #34860

    Hello Brajesh,

    First, I hope you and your family are doing well through this tough year and pandemic.

    I am working on my own custom view for bbpress and the code seems to be ok but when I go to the url for the view, it doesn’t work. What am I missing?

    Thanks again for all your help and this wonderful community. I hope this custom view code can help others with some functionality with getting the latest topics by freshness.

    function my_custom_register_views() {
         // Latest Replies Custom View
        bbp_register_view(
            'latest-replies',
            __( 'Latest Replies', 'buddyboss' ),
            apply_filters( 'bbp_register_view_latest_replies', array(
                    'orderby' => 'meta_value',
                    'order' => 'DESC',
                    'meta_key' => '_bbp_last_active_time',
                    'post_status' => array(bbp_get_public_status_id(), bbp_get_closed_status_id()),
                    'post_type' => bbp_get_topic_post_type(),
                    'show_stickies' => false
            )
        ) );
    }
  • Participant
    Level: Enlightened
    Posts: 104
    Erich199 on #34861

    Scratch that, I forgot the “add_action” part of my code. I’m an idiot.

    add_action( 'bbp_register_views', 'my_custom_register_views' );

    I hope others will benefit from this.

  • Keymaster
    (BuddyDev Team)
    Posts: 19487
    Brajesh Singh on #34865

    Thank you for sharing the issue and the solution.
    I too hope it helps others.

    Regards
    Brajesh

The topic ‘ [Resolved] BBpress Views Function’ is closed to new replies.

This topic is: resolved