Created
August 1, 2018 07:31
-
-
Save bappi-d-great/df3ad91649a7f5b44dd293a21f0b6ad7 to your computer and use it in GitHub Desktop.
Add to BP activity stream when imported using autoblog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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