-
-
Save imath/24fdfa1b8625477e93c0daa0d90b2a44 to your computer and use it in GitHub Desktop.
Fix bbPress pagination in BP Member's forum page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Exit if accessed directly. | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; | |
| } | |
| /** | |
| * bbPress should include such an action into its `src/includes/extend/buddypress/members.php` file. | |
| */ | |
| function fix_bbpress_member_pagination( &$query ) { | |
| if ( bp_is_user() && bp_is_current_component( 'forums' ) ) { | |
| $action_variables = (array) bp_action_variables(); | |
| if ( function_exists( 'bbp_get_paged_slug' ) && bbp_get_paged_slug() === bp_action_variable( 0 ) ) { | |
| $query->set( 'paged', (int) bp_action_variable( 1 ) ); | |
| } | |
| } | |
| } | |
| add_action( 'bp_members_parse_query', 'fix_bbpress_member_pagination' ); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI this will be fixed in BP Classic v1.4.0, see buddypress/bp-classic#44