Forums

Join
bbPress Support ForumsTroubleshootingHow to use bbpress pagination in a plugin?

Info

Tags

How to use bbpress pagination in a plugin?

  1. Hi,

    I have the data, but how to use it with bbpress' pagination? Where to put the data?

    I have for excample:
    $mydata = the array with rows from the database that gets displayed
    $mydata_count = total rows counted
    $mydata_pagelimit = total rows that must be shown each page

    Is there any way to hook this into bbpress pagination at all? Or do I have to write one myself?

    Kind regards,

  2. Assuming that $mydata_curpage is the current page number (starting from 1):

    bb_paginate_links( array( 'total' => ceil( $mydata_count / $mydata_pagelimit ), 'current' => $mydata_curpage ) )

    You'll have to do the actual pagination yourself, but that's as simple as an array_slice.

  3. You must log in to post.