Opened 9 years ago
Closed 9 years ago
#6777 closed defect (bug) (fixed)
Typo in bp_activity_set_post_type_tracking_args()
Reported by: | danbrellis | Owned by: | imath |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | minor | Version: | 2.2 |
Component: | Activity | Keywords: | has-patch commit |
Cc: | dcavins |
Description
The function bp_activity_set_post_type_tracking_args adds the post labels in a foreach loop, and then unsets each $arg that was passed to it.
The function says
unset( $args[ $post_type ] );
but since there is no $post_type key in the $args array, I think it should actually be:
unset( $args[ $label_type ] );
Was just poking around in the code and noticed this so sorry if I'm off base here.
Attachments (1)
Change History (8)
#2
@
9 years ago
- Version changed from 2.4.0 to 2.2
@dcavins
Yes sorry for this typo error. This function is not used by BuddyPress internally but is there for plugins wishing to add BuddyPress Post type activities: https://codex.buddypress.org/plugindev/post-types-activities/#customizing-generic-activity-attributes
The goal was to only have the labels ( inside the array like 'bp_activity_admin_filter' ) in $wp_post_types[ $post_type ]->labels
and not "repeated" inside $wp_post_types[ $post_type ]->bp_activity.
Hi @danbrellis-
Thanks for your bug report! I'm not terribly familiar with this particular cul-de-sac of the BuddyPress code, but I agree with your conclusion--it looks like what's meant to happen here is those label arguments are unset so they aren't added to the
$wp_post_types
global.Thanks again for taking the time to write up a report.