Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add link to Unsolved topics

Viewing 5 replies - 1 through 5 (of 5 total)

  • Robkk
    Moderator

    @robkk

    You can create a custom view, use this shortcode in a page [bbp-single-view id='unresolved'], then just link to it in a menu or use the views widget bbPress provides.

    function rkk_register_unresolved_view() {
     	bbp_register_view( 'unresolved', __( 'Unresolved Topics' ), array( 'meta_key' => 'bbr_topic_resolution', 'meta_value' => '2', 'orderby' => 'post_date', 'post_status' => 'publish' ), false );
     }
     add_action( 'bbp_register_views', 'rkk_register_unresolved_view' );

    tech55541
    Participant

    @tech55541

    Hello,
    That code worked great. Could you please help me make another view for solved topics?

    I almost did it myself, but I do not know what or how to find the meta_value that I need.

    Thanks for your help.


    tech55541
    Participant

    @tech55541

    Hello @robkk,
    Does the meta_key have to be a specific value? Or can it be anything? If it is a specific value, how would you find it? I tried inspecting the resolutions toggle for some kind of number, but could not find one.

    Thanks, can’t wait to here back.

    @tech55541
    Checking the code, the value you need is 3 :

    	public function register_defaults() {
    
    		Manager::register( 'not-support', array(
    			'label'     => __( 'Not a Question', 'bbResolutions' ),
    			'value'     => '1',
    		) );
    
    		Manager::register( 'not-resolved', array(
    			'label'     =>  __( 'Not Resolved', 'bbResolutions' ),
    			'value'     => '2',
    		) );
    
    		Manager::register( 'resolved', array(
    			'label'     =>  __( 'Resolved', 'bbResolutions' ),
    			'sticker'   => __( '[Resolved]', 'bbResolutions' ),
    			'value'     => '3',
    		) );
    
    	}

    tech55541
    Participant

    @tech55541

    OK, that makes since.

    Thanks for clearing that up.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar