Changeset 9493
- Timestamp:
- 02/17/2015 06:59:02 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-group.php
r9486 r9493 214 214 if ( ! empty( $this->args['populate_extras'] ) ) { 215 215 216 // Get group admins and mods 216 /** 217 * Filters the SQL prepared statement used to fetch group admins and mods. 218 * 219 * @since BuddyPress (1.5.0) 220 * 221 * @param string $value SQL select statement used to fetch admins and mods. 222 */ 217 223 $admin_mods = $wpdb->get_results( apply_filters( 'bp_group_admin_mods_user_join_filter', $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_email, u.user_nicename, m.is_admin, m.is_mod FROM {$wpdb->users} u, {$bp->groups->table_name_members} m WHERE u.ID = m.user_id AND m.group_id = %d AND ( m.is_admin = 1 OR m.is_mod = 1 )", $this->id ) ) ); 218 224 … … 271 277 $this->date_created = apply_filters( 'groups_group_date_created_before_save', $this->date_created, $this->id ); 272 278 279 /** 280 * Fires before the current group item gets saved. 281 * 282 * Please use this hook to filter the properties above. Each part will be passed in. 283 * 284 * @since BuddyPress (1.0.0) 285 * 286 * @param BP_Groups_Group Current instance of the group item being saved. Passed by reference. 287 */ 273 288 do_action_ref_array( 'groups_group_before_save', array( &$this ) ); 274 289 … … 344 359 $this->id = $wpdb->insert_id; 345 360 361 /** 362 * Fires after the current group item has been saved. 363 * 364 * @since BuddyPress (1.0.0) 365 * 366 * @param BP_Groups_Group Current instance of the group item that was saved. Passed by reference. 367 */ 346 368 do_action_ref_array( 'groups_group_after_save', array( &$this ) ); 347 369 … … 372 394 BP_Groups_Member::delete_all( $this->id ); 373 395 396 /** 397 * Fires before the deletion of a group. 398 * 399 * @since BuddyPress (1.2.0) 400 * 401 * @param BP_Groups_Group $this Current instance of the group item being deleted. Passed by reference. 402 * @param array $user_ids Array of user IDs that were members of the group. 403 */ 374 404 do_action_ref_array( 'bp_groups_delete_group', array( &$this, $user_ids ) ); 375 405 … … 769 799 // 'order' and 'orderby' params passed to the function 770 800 if ( ! empty( $r['type'] ) ) { 801 802 /** 803 * Filters the 'type' parameter used to overwrite 'order' and 'orderby' values. 804 * 805 * @since BuddyPress (2.1.0) 806 * 807 * @param array $value Converted 'type' value for order and orderby. 808 * @param string $value Parsed 'type' value for the get method. 809 */ 771 810 $order_orderby = apply_filters( 'bp_groups_get_orderby', self::convert_type_to_order_orderby( $r['type'] ), $r['type'] ); 772 811 … … 786 825 $order = bp_esc_sql_order( $order ); 787 826 788 // Convert 'orderby' into the proper ORDER BY term 827 /** 828 * Filters the converted 'orderby' term. 829 * 830 * @since BuddyPress (2.1.0) 831 * 832 * @param string $value Converted 'orderby' term. 833 * @param string $orderby Original orderby value. 834 * @param string $value Parsed 'type' value for the get method. 835 */ 789 836 $orderby = apply_filters( 'bp_groups_get_orderby_converted_by_term', self::convert_orderby_to_order_by_term( $orderby ), $orderby, $r['type'] ); 790 837 … … 800 847 } 801 848 802 // Get paginated results 849 /** 850 * Filters the pagination SQL statement. 851 * 852 * @since BuddyPress (1.5.0) 853 * 854 * @param string $value Concatenated SQL statement. 855 * @param array $sql Array of SQL parts before concatenation. 856 * @param array $r Array of parsed arguments for the get method. 857 */ 803 858 $paged_groups_sql = apply_filters( 'bp_groups_get_paged_groups_sql', join( ' ', (array) $sql ), $sql, $r ); 804 859 $paged_groups = $wpdb->get_results( $paged_groups_sql ); … … 852 907 } 853 908 854 // Get total group results 909 /** 910 * Filters the SQL used to retrieve total group results. 911 * 912 * @since BuddyPress (1.5.0) 913 * 914 * @param string $t_sql Concatenated SQL statement used for retrieving total group results. 915 * @param array $total_sql Array of SQL parts for the query. 916 * @param array $r Array of parsed arguments for the get method. 917 */ 855 918 $total_groups_sql = apply_filters( 'bp_groups_get_total_groups_sql', $t_sql, $total_sql, $r ); 856 919 $total_groups = $wpdb->get_var( $total_groups_sql ); … … 1037 1100 global $wpdb, $bbdb; 1038 1101 1039 if ( empty( $bbdb ) ) 1102 if ( empty( $bbdb ) ) { 1103 1104 /** This action is documented in bp-forums/bp-forums-screens */ 1040 1105 do_action( 'bbpress_init' ); 1106 } 1041 1107 1042 1108 if ( !empty( $limit ) && !empty( $page ) ) { … … 1103 1169 global $wpdb, $bbdb; 1104 1170 1105 if ( empty( $bbdb ) ) 1171 if ( empty( $bbdb ) ) { 1172 1173 /** This action is documented in bp-forums/bp-forums-screens */ 1106 1174 do_action( 'bbpress_init' ); 1175 } 1107 1176 1108 1177 if ( !empty( $limit ) && !empty( $page ) ) { … … 1412 1481 $bp->groups->filter_sql = ' AND t.topic_posts = 1'; 1413 1482 1414 // https://buddypress.trac.wordpress.org/ticket/4306 1483 /** 1484 * Filters the portion of the SQL related to global count of forum topics in public groups. 1485 * 1486 * https://buddypress.trac.wordpress.org/ticket/4306. 1487 * 1488 * @since BuddyPress (1.6.0) 1489 * 1490 * @param string $filter_sql SQL portion for the query. 1491 * @param string $type Type of forum topics to query for. 1492 */ 1415 1493 $extra_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp->groups->filter_sql, $type ); 1416 1494
Note: See TracChangeset
for help on using the changeset viewer.