Title: Sending a compliment programatically
Last modified: June 23, 2017

---

# Sending a compliment programatically

 *  Resolved [magland](https://wordpress.org/support/users/magland/)
 * (@magland)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/sending-a-compliment-programatically/)
 * Are there any hooks available to send a compliment automatically?
 * I’d like to use this plugin as a system for people to earn badges (compliments)
   by completing certain tasks.
 * For example when they complete their profile, I’d like to send them the ‘Completed
   Profile’ badge.
 * When they post in a group for the first time they could earn the ‘1st Group post’
   badge.
 * etc, etc
 * Can Buddypress Compliments be used in this way?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Viruthagiri](https://wordpress.org/support/users/viruthagiri/)
 * (@viruthagiri)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/sending-a-compliment-programatically/#post-9255714)
 * Yes its possible with this function.
 * [https://github.com/mistergiri/buddypress-compliments/blob/master/includes/bp-compliments-actions.php#L58](https://github.com/mistergiri/buddypress-compliments/blob/master/includes/bp-compliments-actions.php#L58)
 * But you need some programming skills. If you are not programmer hire someone.
 * Thanks
 *  Thread Starter [magland](https://wordpress.org/support/users/magland/)
 * (@magland)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/sending-a-compliment-programatically/#post-9255769)
 * thanks, are you referring to: bp_compliments_start_compliment() ?
 * I have located that function in bp-compliments-functions.php and can see it has
   the following params:
 * [@param](https://wordpress.org/support/users/param/) string|array $args {
    * 
   Attributes of the $args. * * [@type](https://wordpress.org/support/users/type/)
   int $receiver_id Received ID. * [@type](https://wordpress.org/support/users/type/)
   int $sender_id Sender ID. * [@type](https://wordpress.org/support/users/type/)
   int $term_id Compliment Icon Term ID. * [@type](https://wordpress.org/support/users/type/)
   int $post_id Post ID. * [@type](https://wordpress.org/support/users/type/) string
   $message The compliment Message. * * }
 * What does $post_id refer to in this case?
 * Is it the id of the compliment? How does that differ from $term_id?
 *  [Viruthagiri](https://wordpress.org/support/users/viruthagiri/)
 * (@viruthagiri)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/sending-a-compliment-programatically/#post-9255801)
 * Yes thats the code I was talking about.
 * Post ID is being used only in whoop theme.
 * You don’t have to set that post id. Or set it to 0.
    Its a feature where user
   can send compliment for a post instead of a user.
 * You will get the compliment id only after inserting the compliment.
 * Just look at this part of the code.
 * [https://github.com/mistergiri/buddypress-compliments/blob/master/includes/bp-compliments-actions.php#L30](https://github.com/mistergiri/buddypress-compliments/blob/master/includes/bp-compliments-actions.php#L30)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Sending a compliment programatically’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/buddypress-compliments_ed6d62.svg)
 * [BuddyPress Compliments](https://wordpress.org/plugins/buddypress-compliments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddypress-compliments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddypress-compliments/)
 * [Active Topics](https://wordpress.org/support/plugin/buddypress-compliments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddypress-compliments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddypress-compliments/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Viruthagiri](https://wordpress.org/support/users/viruthagiri/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/sending-a-compliment-programatically/#post-9255801)
 * Status: resolved