Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/23/2014 01:00:46 AM (9 years ago)
Author:
imath
Message:

Make sure paginate links are correctly set in case javascript is disabled

Adding extra query arguments to the 'base' parameter of the paginate_links() function when javascript is disabled is preventing the loops to be correctly paginated. In this particular case, the pagination is 'stuck' on the second page. To be sure the pagination is correctly set, we need to pass extra query arguments using the 'add_args' parameter of the paginate_links() function.

Fixes #5967

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-template.php

    r9210 r9260  
    276276            }
    277277
     278            /**
     279             * Defaults to an empty array to make sure paginate_links()
     280             * won't add the $page_arg to the links which would break
     281             * pagination in case javascript is disabled.
     282             */
     283            $add_args = array();
     284
    278285            if ( ! empty( $search_terms ) ) {
    279                 $pag_args['s'] = urlencode( $search_terms );
     286                $add_args['s'] = urlencode( $search_terms );
    280287            }
    281288
     
    287294                'prev_text' => _x( '←', 'Member pagination previous text', 'buddypress' ),
    288295                'next_text' => _x( '→', 'Member pagination next text', 'buddypress' ),
    289                 'mid_size'   => 1
     296                'mid_size'  => 1,
     297                'add_args'  => $add_args,
    290298            ) );
    291299        }
Note: See TracChangeset for help on using the changeset viewer.