[buddypress-trac] [BuddyPress Trac] #5669: Help plugins to generate activities for their post type(s)

buddypress-trac noreply at wordpress.org
Mon Nov 24 18:44:38 UTC 2014


#5669: Help plugins to generate activities for their post type(s)
-----------------------------------+------------------
 Reporter:  imath                  |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  2.2
Component:  Activity               |     Version:  2.0
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion has-patch  |
-----------------------------------+------------------

Comment (by boonebgorges):

 >     for instance in bp_activity_show_filters(), it seems strange to me
 to call a function which would return nothing used directly.

 It wouldn't return nothing, it would return the types. It's only that
 those types would be generated on the fly, the first time that the
 function is called on a given page load.

 >    imho it would introduce some risks themes wouldn't get all the
 actions if they don't use the specific function before trying to get the
 activity types using the global buddypress()->activity->actions or the
 function bp_activity_get_types()

 This is true of your setup too - everything has to run by bp_fully_loaded.
 My proposal would actually be *more* lenient, since the types wouldn't be
 generated until needed - which will generally be during 'wp' or later.

 But I don't feel strongly about any of this.

 > Translation is giving me headaches!!

 Yeah, but we have to get this right, or we can't do it :)

 I think you're overthinking this. We can't predict what every language
 will do, which is why we have to provide full sentences. And while
 generally we try to keep markup out of translatable strings, it's not a
 hard and fast rule for cases like this. So the proposed 'labels' string
 will look like this:

 {{{
 'bp_activity_new_post' => __( '<a href="%1$s">%2$s</a> posted a new <a
 href="%3$s">foo</a>' )
 }}}

 >  Finally, using the post type labels argument might not be the best way
 in my opinion.

 I take your points. I propose that we support use of the 'labels' array,
 so that people registering support with `register_post_type()` will be
 able to use it. But we can also provide a wrapper like
 `bp_activity_register_tracking_action_format()` (maybe you can think of a
 better name?) which would allow people to register this label for an
 existing post type. Or maybe it could be a more general function for
 updating any aspect of the 'trackable' types.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5669#comment:15>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list