Group_Fetcher::get( int|string $arg )

Get a group ID from its identifier (ID or slug).


Parameters Parameters

$arg

(int|string) (Required) Group ID or slug.


Top ↑

Return Return

(BuddypressCLICommandBP_Groups_Group|bool)


Source Source

File: cli/src/group-fetcher.php

	public function get( $arg ) {

		// Group ID or slug.
		if ( ! is_numeric( $arg ) ) {
			$arg = groups_get_id( $arg );
		}

		// Get group object.
		$group = groups_get_group(
			array(
				'group_id' => $arg,
			)
		);

		if ( empty( $group->id ) ) {
			return false;
		}

		return $group;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.