Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbp_forum_pagination_links – alter the output?


  • Shmoo
    Participant

    @macpresss

    Just curious..

    When I’m at a singel forum page I see a list of all topics from X forum – great but at the button I have this bbp_forum_pagination_links() function and I want to change the HTML structure this function provides but when I search about this function I see this in the Core.

    page

    Yes there is a filter but where does the real magic happen or where is the links structure been created.

    Other option, would it maybe also possible to use a native WordPress pagination function but just link it to the forums Post Type?

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

  • Shmoo
    Participant

    @macpresss

    This is strange..

    Why is my filter not working. When I look at my screenshot you can see that this array has an apply_filter() function before the variable/array goes through the paginate_links().
    This filter I should use, I expect if I want to make any changes to the array before it gets pulled into the paginate_links() function – right?

    topic forum pagination bbPress

    So I created this add_filter function to test if I can change the <– arrow –> symbols. But for some reason no success at all.

    
    function xx_my_stuff( $bbp_topic_pagination ) {
    
    	$bbp_topic_pagination = array(
    		'prev_text' => 'test',
    		'next_text' => 'test',
    	);
    	return $bbp_topic_pagination;
    
    }
    add_filter( 'bbp_topic_pagination', 'xx_my_stuff' );
    

    Robkk
    Moderator

    @robkk

    Does what is in this gist help any??

    https://gist.github.com/ntwb/10bf67b898e25db59b1f


    Shmoo
    Participant

    @macpresss

    Yes great find, thank you Robkk,

    Now you can also do this, ..and make the pagination an unordered list like it should be by the default. 🙂

    
    function ntwb_bbpress_custom_pagination( $args ) {
    
    	$args['type'] = 'list';
    	$args['prev_text'] = 'previous';
    	$args['next_text'] = 'next';
    
    	return $args;
    
    }
    add_filter( 'bbp_topic_pagination', 'ntwb_bbpress_custom_pagination' );
    

    WP Codex: all those args should probably work now.
    https://codex.wordpress.org/Function_Reference/paginate_links


    Robkk
    Moderator

    @robkk

    Alright cool. Glad you are sorted out now. 🙂

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