Opened 15 years ago
Closed 14 years ago
#2338 closed defect (bug) (fixed)
bp-activity-templatetags Slugs
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | Version: | ||
Component: | Activity | Keywords: | bp-activity-templatetags BP_GROUPS_SLUG BP_FRIENDS_SLUG |
Cc: |
Description
bp-activity-templatetags.php must user BP_GROUPS_SLUG and BP_FRIENDS_SLUG instead 'groups' and 'friends'
'friends' == $scope | 'groups' == $scope | 'favorites' == $scope | 'mentions' == $scope ) { |
BP_FRIENDS_SLUG == $scope | BP_GROUPS_SLUG == $scope | 'favorites' == $scope | 'mentions' == $scope ) { |
case 'friends':
case BP_FRIENDS_SLUG:
case 'groups':
case BP_GROUPS_SLUG:
Change History (7)
#2
@
14 years ago
I agree that this needs to be done in various places throughout BP, but I'm not sure that the specific location mentioned in bp-activity-templatetags.php is one of them. The strings in question ('friends' and 'groups') are literals that are function arguments. Unlike URL slugs, they're not user-facing at all (and they have no connection to anything user-facing, since they're entered on the template), so there's not a hugely compelling argument for making them translatable. On the other hand, there is an argument (albeit perhaps a small one) for not making them translatable: documentation like http://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/ becomes a bit more complicated, because you can no longer say for certain what the 'object' parameter should be for core components.
#4
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
I think we need to use $bp->pages->{profile}->slug & ->name for trunk to support page renaming in wp-admin. I haven't tested this yet.
#6
@
14 years ago
Re: $bp->pages support. $bp->pages is set up via a chain that ends in bp-core.php, bp_core_get_page_names(). That function shows that $bp_pages is set by 1) getting the IDs of bp-pages from the options table, and then 2) directly querying the posts table for the slugs. In other words, page renaming should already be taken care of.
$bp->current_component (and current_action) are set in bp_core_set_uri_globals() (bp-core-catchuri.php) by breaking the REQUEST URI into uri chunks. So current_component should always correspond to component slugs, since they're guaranteed to be formatted for appearances in URIs. bp_get_current_component_slug() therefore seems like it'd be redundant with bp_current_component().
This needs to get done but touches too many files for it to make it into 1.2.4.
Bumped to 1.3.