I am trying to: Display the New Added and Updated Custom Post Types in Buddypress Activity
I have inserted the below code in Settings/Custom Code, and does not work
The Custom Post Type Name is "Contacts" and the slug is -partner-
Please advice. thx
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
function gg_types_post_type_args_filter( $args, $post_type ) {
if ( $post_type == 'partner' ) {
$args['supports'][] = 'buddypress-activity';
$args['bp_activity'] = array(
'component_id' => buddypress()->activity->id,
'action_id' => 'new_stage',
'contexts' => array(
'activity',
'member'),
'position' => 40,
);
$args['labels']['bp_activity_admin_filter'] = __( 'New %s published', 'types-bp-activity' );
$args['labels']['bp_activity_front_filter'] = __( 'Contacts', 'types-bp-activity' );
$args['labels']['bp_activity_new_post'] = __( '%1$s posted a new contact', 'types-bp-activity' );
$args['labels']['bp_activity_new_post_ms'] = __( '%1$s posted a new contact, on the site %3$s', 'types-bp-activity' );
}
return $args;
}
add_filter( 'wpcf_type', 'gg_types_post_type_args_filter', 10, 2 );
Link to a page where the issue can be seen:
I expected to see:
Instead, I got: