[Bb-trac] [bbPress] #1050: $page should be calculated BEFORE bb_init
bbPress
bb-trac at lists.bbpress.org
Wed Mar 4 05:28:36 GMT 2009
#1050: $page should be calculated BEFORE bb_init
----------------------+-----------------------------------------------------
Reporter: _ck_ | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 1.0-beta & XML-RPC
Component: Back-end | Version: 0.9.0.3
Severity: normal | Keywords:
----------------------+-----------------------------------------------------
I've discovered when pretty-permalinks are turned on, it can cause some
queries to fail and people get redirected back to page 1 when they
requested page 2
I noticed that $page is calculated AFTER bb_init in bb-settings.php and
guessed that it was messing with some plugins.
This mini-plugin workaround solved the whole problem:
{{{
add_action('bb_init','fix_pages',1);
function fix_pages() {global $page; $page=bb_get_uri_page();}
}}}
$page should be available to plugins during bb_init anyway
I would change the bottom of bb-settings.php to look like this:
{{{
bb_current_user();
$page = bb_get_uri_page();
do_action('bb_init', '');
if ( bb_is_user_logged_in() && bb_has_broken_pass() )
bb_block_current_user();
bb_send_headers();
}}}
--
Ticket URL: <http://trac.bbpress.org/ticket/1050>
bbPress <http://bbpress.org/>
Innovative forum development
More information about the Bb-trac
mailing list