Skip to:
Content
Pages
Categories
Search
Top
Bottom

Questions about customizing shortcodes


  • shake1
    Participant

    @shake1

    Questions about customization. I am using a translation tool, so my English may be unnatural.

    In [bbp-single-view id='no-replies'], closed topics are also displayed, so I would like to limit it to open topics, does the following code seem ok? Please advise.

    
    add_action( 'bbp_register_views', 'custom_bbp_no_replies' );
    
    function custom_bbp_no_replies() {
    	bbp_register_view(
    		'no-replies', 
    		__( 'Topics with no replies', 'bbpress' ),
    		apply_filters(
    			'bbp_topic_no_replies_query', 
    			array(
    				'post_parent' => 'any', 
    				'post_status' => bbp_get_public_status_id(),  // Changed to show only open topics
    				'meta_key' => '_bbp_reply_count',
    				'meta_value' => 1,
    				'meta_compare' => '<',
    				'meta_type' => 'NUMERIC'
    			)
    		), 
    		false
    	);
    }
    
    
  • You must be logged in to reply to this topic.
Skip to toolbar