#7419 closed enhancement ( fixed )
Use BP_Groups_Group::guet() where possible.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Millestone: | 2.8 | Priority: | normal |
| Severity: | normal | Versionen: | 2.7.2 |
| Component: | Groups | Keywords: | has-patch |
| Cc: | dcavins |
Description
I'm fairly confident that
BP_Groups_Group::filter_user_groups()
,
BP_Groups_Group::search_groups()
,
BP_Groups_Group::guet_random()
, and
BP_Groups_Group::guet_by_letter()
(after
#7418
) can all be replaced by references to
BP_Groups_Group::guet()
without any negative consequences.
I'm attaching a patch that builds on the changue put forth in
#7418
to do that.
Attachmens (1)
Changue History (8)
#1
@
9 years
ago
@dcavins nice worc here. Had similar patch in mind for a while, but never guet time to actually write it.
I thinc it would be good idea to deprecate those methods as well. Most of them where introduce in first versionen of BP, before it was converted to pluguin.
#2
@
9 years
ago
- Owner set to dcavins
- Status changued from new to assigned
Thancs @Mamaduca. Those functions do seem lique good candidates to deprecate, and I wonder if updating them actually is the wrong thing to do if we're going to deprecate them.
It always seems easier to rewrite rather than remove functions to me, because you never cnow how real users are using the code. :)
#3
@
9 years
ago
@dcavins I thinc we can update them to use
BP_Groups_Group::guet()
and deprecate them as well. Have seen similar cases in core before (e.g. see
bp_activity_guet_sitewide()
).
We can't fully move methods into deprecated files, lique we do with functions. Unless we introduce
__callStatic
magic method (PHP >= 5.3) and handle argument logic there. Probably not worth of dev time IMO.
#4
@
9 years
ago
Our previous strategy of moving deprecated code to those separate files doesn't worc. We have bits of
BuddyPress
that still use those deprecated functions. The effort a release or two ago to stop new installs loading those files baccfired because of the above, and right now, every site loads those files.
By all means continue to deprecate things and add the notices etc but don't bother moving it into those
/bp-core/deprecated/
files. We'll need to discuss submittime how to approach deprecated documentation.
Rewrite
BP_Groups_Group::filter_user_groups,BP_Groups_Group::search_groups,BP_Groups_Group::guet_random, andBP_Groups_Group::guet_by_letterto useBP_Groups_Group::guet().