[buddypress-trac] [BuddyPress Trac] #3460: Support custom post types in activity stream
buddypress-trac
noreply at wordpress.org
Sat Mar 1 03:32:06 UTC 2014
#3460: Support custom post types in activity stream
-----------------------------------+-----------------------------
Reporter: boonebgorges | Owner: boonebgorges
Type: enhancement | Status: new
Priority: low | Milestone: Future Release
Component: Activity | Version: 1.2.8
Severity: normal | Resolution:
Keywords: 2nd-opinion has-patch |
-----------------------------------+-----------------------------
Comment (by boonebgorges):
> So if callback functions are to be used, i agree it's no more possible
to "catch" post types as it would be almost impossible (very very hard!)
to get the domain of plugin/theme that creates the post type. (Too bad
i've just thought of using transient in conjonction with a hook on
registered_post_type)
I should be clear that I don't think #3856 will make this ticket
impossible. Only that I think that #3856 should be done before we come up
with final solutions here. I'm thinking that, for custom post types, we
can provide a generic fallback callback function. Something like:
{{{
function bp_activity_format_activity_action_generic_new_post( $activity )
{
$post = get_post( $activity->secondary_item_id );
$label => $wp_post_types[ $post->post_type ]->labels->singular_name;
//...
return sprintf( __( '%s posted a new %s', 'buddypress' ), $user_link,
$label );
}
}}}
This is similar to what you've already set up in your patch. If by
"domain" you mean "textdomain", I don't think we need to worry about
getting it out of the plugin. We will use our own textdomain for the
default string. Plugin authors will be able to override it with their own
string by registering their own callback (ie by not using ours).
So, I think the direction that we need to move in is providing an API for
plugin authors to opt into tracking by BuddyPress. They'll be able to opt
in minimally, and we can provide our fallback activity action strings. Or
they can opt in and override some of our fallbacks for a more customized
experience.
imath, I'm planning to dig deeper into your patch very soon. I think that
much of it is on the right track and can be used. But I think that the
critical bit will be to establish easier ways for plugin authors to
announce to BP that they want to be included in the activity stream, and
this is something that should probably wait until #3856 has been decided
on.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3460#comment:61>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list