[buddypress-trac] [BuddyPress] #2086: Some slugs need to be changeable, add language strings.

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Sat Dec 3 17:58:26 UTC 2011


#2086: Some slugs need to be changeable, add language strings.
-------------------------------------------------+-------------------------
 Reporter:  sulley                               |       Owner:
     Type:  enhancement                          |  boonebgorges
 Priority:  major                                |      Status:  assigned
Component:  Core                                 |   Milestone:  1.6
 Severity:  normal                               |     Version:
 Keywords:  dev-feedback has-patch needs-        |  Resolution:
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by boonebgorges):

 Thanks for the helpful feedback, Paul!

 > The slug array could be e.g. array( $slug_key => array( $slug,
 $description= ) ).

 Great idea. I've made the change. It required making the parsing logic a
 bit more complex (needed to wp_parse_args at a lower level) but it seems
 to work nicely. It's set up currently so that plugins would be able to
 filter these values if desired, and they could also be saved in the
 database (if that was needed for some reason), but they'll always fall
 back on those provided in the component constructor.

 > I'd like to vote for using something like: bp_activity_get_slug( 'key' )

 I'm kind of indifferent here. If we really want to make it simple, why not
 just use bp_get_slug( 'activity', $key ) throughout? I personally prefer
 fewer template tags, but I know that we have a convention of setting
 things up so that you never have to pass an argument to a function inside
 of a template file. I didn't change anything in 03.patch, but I can do
 whatever if there's a general consensus. It's trivial to swap out.

 > Probably best to do the bp_parse_component_slugs() stuff in the
 BP_Component class itself.

 Good thinking. I was trying to keep BP_Component clean (so I've left the
 _parse_ function in the global scope instead of making it into a method of
 BP_Component), but you're right that this should be handled there.

 See 03.patch.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/2086#comment:14>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list