[buddypress-trac] [BuddyPress] #4212: bp_get_button() does not allow a core component button (regression)
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Wed Jun 13 23:55:04 UTC 2012
#4212: bp_get_button() does not allow a core component button (regression)
------------------------------------+------------------
Reporter: johnbillion | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 1.6
Component: Core | Version: 1.5
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------
Comment (by cnorris23):
> I am wondering about where/how this function was used without a
component being specified.
I wondered the same thing. The reason I chose to patch bp_is_active()
directly is two-fold
1) It is technically a regression, since prior to 1.5 a check for
bp_is_active( 'core' ) would return true, since it was never in the
$bp_deactivate components global
{{{
if ( !isset( $bp_deactivated[ 'bp-' . $component . '/bp-' . $component .
'-loader.php' ] ) )
}}}
Obviously, the 'core' check returning true was a matter of happenstance
rather than being intentional, but a regression nonetheless.
2) BP_Button defaults to 'component' => 'core', so technically a function
could pass an array to bp_button/bp_get_button() without 'component'
defined (lazy, but allowed), and still pass the conditional checks.
Changing this behavior would also be a regression.
Changing bp_is_active() to return true when 'core' is passed was the
simplest method with the least amount of impact. Personally, I like the
idea of setting 'component' to an empty string in the BP_Button defaults,
on top of adding the extra check in bp_is_active(), but it will likely
break a few plugins.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4212#comment:5>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list