Changeset 8249 for trunk/bp-activity/bp-activity-classes.php
- Timestamp:
- 04/07/2014 05:33:26 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-classes.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r8226 r8249 1106 1106 1107 1107 /** 1108 * Get a list of components that have recorded activity associated with them 1109 * 1108 * Get a list of components that have recorded activity associated with them. 1109 * 1110 * @param bool $skip_last_activity If true, components will not be 1111 * included if the only activity type associated with them is 1112 * 'last_activity'. (Since 2.0.0, 'last_activity' is stored in 1113 * the activity table, but these items are not full-fledged 1114 * activity items.) Default: true. 1110 1115 * @return array List of component names. 1111 1116 */ 1112 public static function get_recorded_components( ) {1117 public static function get_recorded_components( $skip_last_activity = true ) { 1113 1118 global $wpdb, $bp; 1114 return $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ); 1119 1120 if ( $skip_last_activity ) { 1121 $components = $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} WHERE action != '' AND action != 'last_activity' ORDER BY component ASC" ); 1122 } else { 1123 $components = $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ); 1124 } 1125 1126 return $components; 1115 1127 } 1116 1128
Note: See TracChangeset
for help on using the changeset viewer.