get_post_meta doesn’t work in activity stream
-
Hello, i try to customize my activity stream items for a custom post type. I want to display a custom field as activity content, but the function
get_post_meta()
didn’t seem to work.Here’s my code so far. It’s basically the one from the documentation:
function record_cpt_activity_content( $cpt ) { if ( 'new_guide' === $cpt['type'] ) { $cpt['content'] = get_post_meta( $cpt['secondary_item_id'], 'guide_description', true ); } return $cpt; } add_filter('bp_before_activity_add_parse_args', 'record_cpt_activity_content');
I can use a simple string as content and it appears on new activitys. Also other functions like
get_permalink( $cpt['secondary_item_id'] );
are no problem.But I can’t get
get_post_meta()
to work. Am i missing something?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘get_post_meta doesn’t work in activity stream’ is closed to new replies.