Custom post type activities
-
https://codex.buddypress.org/plugindev/post-types-activities/
Hi, I’m using code similar to the above link to post timeline activities
from several of my registered custom post types.If I share one of these custom post type activities, the header text is missing the name of the original poster.
Instead it just appears as “shared ‘s update”
It should be “shared [NAME HERE]‘s update”
I have found the function bp_activity_action_bp_share_activity() in class-bp-activity-share-public-ajax.php
I have attempted to debug the function as below:
It appears that the $action variable is wrong in this particular instance:
// Prepare activity arguments. $activity_args = array( 'user_id' => $current_user_id, 'action' => $action, 'component' => $component, 'content' => $content, 'type' => 'bp_activity_share', 'primary_link' => $current_profile_link, 'secondary_item_id' => $secondary_item_id, 'item_id' => $item_id, ); $activity_id = bp_activity_add( $activity_args );
$action uses sprintf (in various places in that function) to replace $parent_profile_link.
// Parent activity user's profile link. $parent_profile_link = bp_core_get_userlink( $user_id );
It would appear that $user_id is wrong when sharing a custom post type activity.
Any help?
- The topic ‘Custom post type activities’ is closed to new replies.