BP_Invitation:填充()
从数据库中获取现有邀请的数据。
描述
源
文件:bp-core /类/ class-bp-invitation.php
Public function populate() {global $wpdb;$ invites_table_name = BP_Invitation_Manager: get_table_name ();//检查缓存的邀请数据。$this->id = wp_cache_get($this->id, 'bp_invitation ');//缓存丢失,查询数据库。if (false === $invite) {$invite = $wpdb->get_row($wpdb->准备("SELECT * FROM {$invites_table_name} WHERE id = %d", $this->id));Wp_cache_set ($this->id, $invitation,'bp_invitation '); / /发送邀请} //没有发现邀请,所以设置ID和保释。If (empty($ invite) || is_wp_error($ invite)) {$this->id = 0; / /设置>id返回; } $this->user_id = (int) $invitation->user_id; $this->inviter_id = (int) $invitation->inviter_id; $this->invitee_email = $invitation->invitee_email; $this->class = sanitize_key( $invitation->class ); $this->item_id = (int) $invitation->item_id; $this->secondary_item_id = (int) $invitation->secondary_item_id; $this->type = $invitation->type; $this->content = $invitation->content; $this->date_modified = $invitation->date_modified; $this->invite_sent = (int) $invitation->invite_sent; $this->accepted = (int) $invitation->accepted; }
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.3.5 | 介绍了。 |