bp_blogs_new_blog_post

Fires after BuddyPress has recorded metadata about a published blog post.

Description

do_action( 'bp_blogs_new_blog_post', (int) $post_id, (WP_Post) $post, (string) $args_user_id ); 

Parameters (3)

0. $post_id (int)
ID of the blog post being recorded.
1. $post (WP_Post)
WP_Post object for the current blog post.
2. $args_user_id (string)
ID of the user associated with the current blog post.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'bp_blogs_new_blog_post', $post_id, $post, $args_user_id ); 
The following example is for adding a hook callback.
  1. // define the bp_blogs_new_blog_post callback 
  2. function action_bp_blogs_new_blog_post( $post_id, $post, $args_user_id ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'bp_blogs_new_blog_post', 'action_bp_blogs_new_blog_post', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'bp_blogs_new_blog_post', 'action_bp_blogs_new_blog_post', 10, 3 ); 

Defined (1)

The action is defined in the following location(s).

/bp-blogs/bp-blogs-functions.php  
  1. do_action( 'bp_blogs_new_blog_post', $post->ID, $post, $args['user_id'] );