[buddypress-trac] [BuddyPress] #3460: Support custom post types in activity stream
buddypress-trac
noreply at wordpress.org
Thu Nov 21 18:47:56 UTC 2013
#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: has-patch 2nd-opinion |
-----------------------------------+-----------------------------
Changes (by imath):
* keywords: => has-patch 2nd-opinion
Comment:
Replying to [comment:43 trishasalas]:
> @imath, I really like your solution, is there a way to account for
existing post types with this method do you think?
Thanks for your feedback and yes there is. If you look at the function
{{{bp_blogs_extend_initial_post_types()}}} we could loop in the different
post types to add a support for "bp_tracking". But it would need to first
deal with the post_type "post" to have a default behavior to rely on for
the bp_tracking array of callback action, and then simply add support for
the others (except for the attachment post type maybe..).
But i really think, it's not a so good idea. Because, it will risk to
reverse the logic ! Some users might be unsatisfied that every post type
is now tracked into the activity stream...
I've edited the patch for 3460.2.diff. I've added to it the work you've
done with singular names, so now it's really easy to add a support to the
site tracking component for a post type. You simply need to add a few
characters in the functions.php of your theme, let's take the post type
page as an example :
{{{add_post_type_support( 'page', 'bp_tracking' );}}}
And every page you will post or comment on will be tracked.
I've also modified the activity filter options, so that when a post type
has a "bp_tracking" support, then the different dropdowns on front or in
back end have the post_type filter options.
Finally, i've adapted the disable activity comment feature that we can set
in BuddyPress settings to also apply it to post types that has a support
for bp_tracking.
What everyone is thinking about it ?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3460#comment:44>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list