Advertisement
verygoodplugins

Untitled

Mar 27th, 2020
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. function send_message_to_student_113( $user_id, $tags_applied ) {
  2.  
  3.     $tag_id = wp_fusion()->user->get_tag_id( 'completed 1.1.3' );
  4.  
  5.     if ( in_array( $tag_id, $tags_applied ) ) {
  6.  
  7.         $args = array(
  8.             'sender_id'  => 1,
  9.             'thread_id'  => false,
  10.             'recipients' => $user_id,
  11.             'subject'    => 'Hello there',
  12.             'content'    => 'You are getting this message because you completed the first lesson of this project',
  13.             'date_sent'  => bp_core_current_time()
  14.         );
  15.  
  16.         $result = messages_new_message( $args );
  17.  
  18.     }
  19. }
  20. add_action( 'wpf_tags_applied', 'send_message_to_student_113', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement