CPT activity feed – Change generic activity message
-
Greetings,
I have a CPT “events” that I want to display on the activity feed. I stumbled upon this page: https://codex.buddypress.org/plugindev/post-types-activities/ which tells you how to implement it.
I have added
add_post_type_support( 'page', 'buddypress-activity' );
to the custom-bp.php which works and indeed shows a post once I add a new event.However, the message it shows is a bit generic (Name wrote a new item) which I would like to change (including featured image).
In the above-mentioned link it does explain how to do this (changing the text) but for some reason, I can’t make it work. I added the following code as mentioned to my custom-bp.php but it just does not change the message:
function customize_page_tracking_args() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'events', array( 'component_id' => buddypress()->blogs->id, 'action_id' => 'new_blog_page', 'bp_activity_admin_filter' => __( 'Published a new page', 'custom-domain' ), 'bp_activity_front_filter' => __( 'Events', 'custom-domain' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new <a href="%2$s">event</a>', 'custom-textdomain' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">event</a>, on the site %3$s', 'custom-textdomain' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_page_tracking_args' );
Also, in the best case I would like to add the featured image to it which is clickable (exactly how it does it for a normal blog entry).
Can somebody tell me what I do wrong?
- You must be logged in to reply to this topic.