friends_friendship_date_created_before_save

  • apply_filters( 'friends_friendship_date_created_before_save',      $this->date_created,      $this->id )

    Source Reference:

    • Component: BuddyPress :: bp-friends
      File: /bp-friends/bp-friends-classes.php :: Trac Source Line: 63
      	}
      
      	function save() {
      		global $wpdb, $bp;
      
      		$this->initiator_user_id = apply_filters( 'friends_friendship_initiator_user_id_before_save', $this->initiator_user_id, $this->id );
      		$this->friend_user_id    = apply_filters( 'friends_friendship_friend_user_id_before_save',    $this->friend_user_id,    $this->id );
      		$this->is_confirmed      = apply_filters( 'friends_friendship_is_confirmed_before_save',      $this->is_confirmed,      $this->id );
      		$this->is_limited        = apply_filters( 'friends_friendship_is_limited_before_save',        $this->is_limited,        $this->id );
      		$this->date_created      = apply_filters( 'friends_friendship_date_created_before_save',      $this->date_created,      $this->id );
      
      		do_action_ref_array( 'friends_friendship_before_save', array( &$this ) );
      
      		if ( $this->id ) {
      			// Update
      			$result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET initiator_user_id = %d, friend_user_id = %d, is_confirmed = %d, is_limited = %d, date_created = %s ) WHERE id = %d", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created, $this->id ) );
      		} else {
      			// Save
      			$result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->friends->table_name} ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES ( %d, %d, %d, %d, %s )", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created ) );
      			$this->id = $wpdb->insert_id;
      

Comments are closed.