BP_Notifications_Notification:: get_total_count (数组args美元)
获取匹配一组参数的通知总数。
描述
另请参阅
参数
- args美元
-
(数组)(必需)看到BP_Notifications_Notification: get ().
返回
(int)清点已找到的物品。
源
文件:bp-notifications /类/ class-bp-notifications-notification.php
Public static function get_total_count($args){全局$wpdb;//解析参数。$r = self::parse_args($args);/ /加载BuddyPress。英国石油美元= buddypress ();/ /元数据。$r['meta_query'] = self::get_meta_query_sql($r['meta_query']);/ /选择。$select_sql = "SELECT COUNT(*)";/ /。 $from_sql = "FROM {$bp->notifications->table_name} n "; // JOIN. $join_sql = $meta_query_sql['join']; // WHERE. $where_sql = self::get_where_sql( array( 'id' => $r['id'], 'user_id' => $r['user_id'], 'item_id' => $r['item_id'], 'secondary_item_id' => $r['secondary_item_id'], 'component_name' => $r['component_name'], 'component_action' => $r['component_action'], 'is_new' => $r['is_new'], 'search_terms' => $r['search_terms'], 'date_query' => $r['date_query'] ), $select_sql, $from_sql, $join_sql, $meta_query_sql ); // Concatenate query parts. $sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql}"; // Return the queried results. return (int) $wpdb->get_var( $sql ); }
更新日志
版本 | 描述 |
---|---|
BuddyPress 1.9.0 | 介绍了。 |