xprofile_data_user_id_before_save

  • apply_filters( 'xprofile_data_user_id_before_save',      $this->user_id,         $this->id )

    Source Reference:

    • Component: BuddyPress :: bp-xprofile
      File: /bp-xprofile/bp-xprofile-classes.php :: Trac Source Line: 869
      		$retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = %d", $this->field_id ) );
      
      		return apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, &$this ) );
      	}
      
      	function save() {
      		global $wpdb, $bp;
      
      		$this->user_id      = apply_filters( 'xprofile_data_user_id_before_save',      $this->user_id,         $this->id );
      		$this->field_id     = apply_filters( 'xprofile_data_field_id_before_save',     $this->field_id,        $this->id );
      		$this->value        = apply_filters( 'xprofile_data_value_before_save',        $this->value,           $this->id );
      		$this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', bp_core_current_time(), $this->id );
      
      		do_action_ref_array( 'xprofile_data_before_save', array( &$this ) );
      
      		if ( $this->is_valid_field() ) {
      			if ( $this->exists() && !empty( $this->value ) && strlen( trim( $this->value ) ) ) {
      				$result   = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );
      

Comments are closed.