Skip to content

Instantly share code, notes, and snippets.

@bappi-d-great
Created August 1, 2018 07:31
Show Gist options
  • Save bappi-d-great/df3ad91649a7f5b44dd293a21f0b6ad7 to your computer and use it in GitHub Desktop.
Save bappi-d-great/df3ad91649a7f5b44dd293a21f0b6ad7 to your computer and use it in GitHub Desktop.
Add to BP activity stream when imported using autoblog
<?php
add_action( 'autoblog_post_post_insert', function( $post_id, $details, $item ) {
if( function_exists( 'bp_activity_add' ) )
{
bp_activity_add( array(
'action' => '<a href="' . get_author_posts_url( get_the_author_meta( '$post_id' ) ) . '">tota</a> wrote a new <a href="' .get_permalink( $post_id ) . '">post</a>',
'component' => 'post',
'type' => 'new_blog_post',
'hide_sitewide' => false
) );
}
}, 99, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment