Skip to:

Opened 3 years ago

Last modified 3 years ago

#7742 new defect (bug)

bp_has_members( bp_ajax_querystring( 'members' )

Reported by: Venutius Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Core Keywords: needs-codex


Looking at the documentation here:

It does not actually say how you would apply the arguments to this string.

The forum posts show you need to use &, so:

`bp_has_members( bp_ajax_querystring( 'members' ) . '&per_page=20&type=alphabetical' ));'

Will return the members loop as alphabetical and with 20 members per page.


bp_has_members( bp_ajax_querystring( 'members' ) . '&type=alphabetical' ));'

Does not produce an alphabetical list, in order to get that to work you need to remove the &.

'&exclude=3' seems to have no affect at all.

Am I using this incorrectly? (since others seem to be able to get this to work, in the past though I have a forum post with another user having the same problem).

Either way I think it needs to be looked at, and the documentation updated to explain the usage of the filter options, just so novices aren't looking all over for a code snippet that actually works for them.

Change History (1)

#1 @r-a-y
3 years ago

  • Keywords needs-codex added
  • Milestone changed from Awaiting Review to Awaiting Contributions

The correct method is to filter 'bp_ajax_querystring' to modify the arguments due to how the bp_ajax_querystring() function sets the parameters in the members loop:

When using the filter, be sure to do checks against the $object so you are filtering against the members loop and not another loop.

Last edited 3 years ago by r-a-y (previous) (diff)
Note: See TracTickets for help on using tickets.