bp_activity_custom_update

  • apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] )

    Source Reference:

    • Component: BuddyPress :: bp-themes
      File: /bp-themes/bp-default/_inc/ajax.php :: Trac Source Line: 173
      	$activity_id = 0;
      	if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) {
      		$activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) );
      
      	} elseif ( $_POST['object'] == 'groups' ) {
      		if ( !empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) )
      			$activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) );
      
      	} else {
      		$activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] );
      	}
      
      	if ( empty( $activity_id ) ) {
      		echo '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '</p></div>';
      		return false;
      	}
      
      	if ( bp_has_activities ( 'include=' . $activity_id ) ) : ?>
      		<?php while ( bp_activities() ) : bp_the_activity(); ?>
      			<?php locate_template( array( 'activity/entry.php' ), true ) ?>
      
  • apply_filters( 'bp_activity_custom_update', $object, $item_id, $content )

    Source Reference:

    • Component: BuddyPress :: bp-activity
      File: /bp-activity/bp-activity-actions.php :: Trac Source Line: 222
      	// Post to groups object
      	} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {
      		if ( (int)$item_id ) {
      			$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
      		}
      
      	// Special circumstance so let filters handle it
      	} else {
      		$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );
      	}
      
      	// Provide user feedback
      	if ( !empty( $activity_id ) )
      		bp_core_add_message( __( 'Update Posted!', 'buddypress' ) );
      	else
      		bp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );
      
      	// Redirect
      	bp_core_redirect( wp_get_referer() );
      

Comments are closed.