[buddypress-trac] [BuddyPress Trac] #6352: Add parameter to differentiate filter values with bp_core_get_specific_users_count_sql
buddypress-trac
noreply at wordpress.org
Mon Apr 6 12:29:45 UTC 2015
#6352: Add parameter to differentiate filter values with
bp_core_get_specific_users_count_sql
------------------------------+---------------------------
Reporter: tw2113 | Owner: boonebgorges
Type: enhancement | Status: closed
Priority: normal | Milestone: 2.3
Component: Component - Core | Version: 1.2
Severity: normal | Resolution: fixed
Keywords: has-patch |
------------------------------+---------------------------
Comment (by boonebgorges):
We usually have separate filter names for these sorts of things. See eg
https://buddypress.trac.wordpress.org/browser/trunk/src/bp-core/classes
/class-bp-core-user.php?marks=387,419#L379. I can't think of anywhere else
where we use the same filter for paged/count SQL strings and differentiate
in the filter with a 'type' flag of this sort. I'm assuming that tw2113
originally suggested this technique because I'd suggested it as a
possibility in a Slack discussion we'd had.
Small argument in favor of different filter names: it keeps the callback
signature closer to that of the parent method. `function
my_get_specific_users_cb( $sql, $user_ids, $limit, $page, $populate_extras
)`, instead of offsetting with a `$type` param.
That said, if people prefer the single filter name with a `$type` param, I
don't care too much. Feel free to revert [9699] with something closer to
what tw2113 originally suggested.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6352#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list