Index: trunk/src/bp-groups/classes/class-bp-groups-group.php
===================================================================
--- trunk/src/bp-groups/classes/class-bp-groups-group.php	(revision 12731)
+++ trunk/src/bp-groups/classes/class-bp-groups-group.php	(revision 13086)
@@ -180,4 +180,6 @@
 	 * Raw arguments passed to the constructor.
 	 *
+	 * Not currently used by BuddyPress.
+	 *
 	 * @since 2.0.0
 	 * @var array
@@ -198,5 +200,20 @@
 	 */
 	public function __construct( $id = null, $args = array() ) {
-		if ( !empty( $id ) ) {
+
+		// Deprecated notice about $args.
+		if ( ! empty( $args ) ) {
+			_deprecated_argument(
+				__METHOD__,
+				'1.6.0',
+				sprintf(
+					/* translators: 1: the name of the method. 2: the name of the file. */
+					esc_html__( '%1$s no longer accepts arguments. See the inline documentation at %2$s for more details.', 'buddypress' ),
+					__METHOD__,
+					__FILE__
+				)
+			);
+		}
+
+		if ( ! empty( $id ) ) {
 			$this->id = (int) $id;
 			$this->populate();
@@ -672,11 +689,24 @@
 	 *
 	 * @since 1.6.0
+	 * @since 10.0.0 Updated to add the deprecated notice.
 	 *
 	 * @param string      $slug       Slug to check.
 	 * @param string|bool $table_name Deprecated.
-	 * @return int|null Group ID if found; null if not.
+	 * @return int|null|bool False if empty slug, group ID if found; `null` if not.
 	 */
 	public static function group_exists( $slug, $table_name = false ) {
-		global $wpdb;
+
+		if ( false !== $table_name ) {
+			_deprecated_argument(
+				__METHOD__,
+				'1.6.0',
+				sprintf(
+					/* translators: 1: the name of the method. 2: the name of the file. */
+					esc_html__( '%1$s no longer accepts a table name argument. See the inline documentation at %2$s for more details.', 'buddypress' ),
+					__METHOD__,
+					__FILE__
+				)
+			);
+		}
 
 		if ( empty( $slug ) ) {
@@ -684,13 +714,13 @@
 		}
 
-		$args = array(
-			'slug'               => $slug,
-			'per_page'           => 1,
-			'page'               => 1,
-			'update_meta_cache'  => false,
-			'show_hidden'        => true,
+		$groups = self::get(
+			array(
+				'slug'              => $slug,
+				'per_page'          => 1,
+				'page'              => 1,
+				'update_meta_cache' => false,
+				'show_hidden'       => true,
+			)
 		);
-
-		$groups = BP_Groups_Group::get( $args );
 
 		$group_id = null;
@@ -710,8 +740,8 @@
 	 *
 	 * @param string $slug See {@link BP_Groups_Group::group_exists()}.
-	 * @return int|null See {@link BP_Groups_Group::group_exists()}.
+	 * @return int|null|bool See {@link BP_Groups_Group::group_exists()}.
 	 */
 	public static function get_id_from_slug( $slug ) {
-		return BP_Groups_Group::group_exists( $slug );
+		return self::group_exists( $slug );
 	}
 
@@ -1056,5 +1086,14 @@
 		// Backward compatibility with old method of passing arguments.
 		if ( ! is_array( $args ) || count( $function_args ) > 1 ) {
-			_deprecated_argument( __METHOD__, '1.7', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
+			_deprecated_argument(
+				__METHOD__,
+				'1.7',
+				sprintf(
+					/* translators: 1: the name of the method. 2: the name of the file. */
+					esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ),
+					__METHOD__,
+					__FILE__
+				)
+			);
 
 			$old_args_keys = array(
@@ -1537,7 +1576,17 @@
 	 */
 	public static function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
-		global $wpdb;
-
-		$pag_sql = $hidden_sql = $exclude_sql = '';
+
+		if ( true !== $populate_extras ) {
+			_deprecated_argument(
+				__METHOD__,
+				'1.6.0',
+				sprintf(
+					/* translators: 1: the name of the method. 2: the name of the file. */
+					esc_html__( '%1$s no longer accepts setting $populate_extras. See the inline documentation at %2$s for more details.', 'buddypress' ),
+					__METHOD__,
+					__FILE__
+				)
+			);
+		}
 
 		// Multibyte compliance.
@@ -1552,13 +1601,13 @@
 		}
 
-		$args = array(
-			'per_page'       => $limit,
-			'page'           => $page,
-			'search_terms'   => $letter . '*',
-			'search_columns' => array( 'name' ),
-			'exclude'        => $exclude,
+		return self::get(
+			array(
+				'per_page'       => $limit,
+				'page'           => $page,
+				'search_terms'   => $letter . '*',
+				'search_columns' => array( 'name' ),
+				'exclude'        => $exclude,
+			)
 		);
-
-		return BP_Groups_Group::get( $args );
 	}
 
@@ -1569,4 +1618,5 @@
 	 *
 	 * @since 1.6.0
+	 * @since 10.0.0 Deprecate the `$populate_extras` arg.
 	 *
 	 * @param int|null          $limit           Optional. The max number of results to return.
@@ -1578,6 +1628,5 @@
 	 * @param string|bool       $search_terms    Optional. Limit groups to those whose name
 	 *                                           or description field contain the search string.
-	 * @param bool              $populate_extras Optional. Whether to fetch extra
-	 *                                           information about the groups. Default: true.
+	 * @param bool              $populate_extras Deprecated.
 	 * @param string|array|bool $exclude         Optional. Array or comma-separated list of group
 	 *                                           IDs to exclude from results.
@@ -1590,14 +1639,28 @@
 	 */
 	public static function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
-		$args = array(
-			'type'               => 'random',
-			'per_page'           => $limit,
-			'page'               => $page,
-			'user_id'            => $user_id,
-			'search_terms'       => $search_terms,
-			'exclude'            => $exclude,
+
+		if ( true !== $populate_extras ) {
+			_deprecated_argument(
+				__METHOD__,
+				'10.0.0',
+				sprintf(
+					/* translators: 1: the name of the method. 2: the name of the file. */
+					esc_html__( '%1$s no longer accepts setting $populate_extras. See the inline documentation at %2$s for more details.', 'buddypress' ),
+					__METHOD__,
+					__FILE__
+				)
+			);
+		}
+
+		return self::get(
+			array(
+				'type'         => 'random',
+				'per_page'     => $limit,
+				'page'         => $page,
+				'user_id'      => $user_id,
+				'search_terms' => $search_terms,
+				'exclude'      => $exclude,
+			)
 		);
-
-		return BP_Groups_Group::get( $args );
 	}
 
