#3399 closed enhancement (fixed)
Audit usage of bp_is_current_component()
Reported by: | r-a-y | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | has-patch commit |
Cc: |
Description
Attached patch swaps out bp_is_current_component( $component )
with wrapper bp_is_X_component()
functions already created in bp-core-template.php.
Attachments (2)
Change History (14)
#2
@
13 years ago
- Keywords commit added
- Milestone changed from Awaiting Review to 1.5
- Version 1.5 deleted
#3
@
13 years ago
r-a-y, can I ask you to repatch this? It won't apply cleanly because of the whitespace cleanup.
#4
@
13 years ago
Repatched!
I noticed some other overlap like:
!bp_is_current_component( 'activity' ) || !bp_is_user()
Which is the same as:
!bp_is_user_activity()
So I added them in this patch. There could be more like this in the codebase.
#5
@
13 years ago
Replacing
!bp_is_current_component( 'activity' ) || !bp_is_user()
with
!bp_is_user_activity()
won't work, as bp_is_user_activity() is only a wrapper function for bp_is_current_component( 'activity' ).
#6
@
13 years ago
I added in the bp_is_user() check for bp_is_user_activity() in the patch, so we should be good!
#10
@
13 years ago
Note I switched the order of a few things not in this exact patch, putting bp_is_user() ahead of the component checks, etc...
When doing multiple checks in succession, always put the check with the least amount of processing first.
Otherwise, thanks as always for the great patch.
Looks good.