bp_get_group_date_created( object|bool $group = false, array|string $args = array() )

Return the created date of the current group in the loop.

Description

Parameters

$group

(Optional) Group object. Default: current group in loop.

Default value: false

$args

(Optional) Array of optional parameters.

  • 'relative'
    (bool) Optional. If true, returns relative created date. eg. active 5 months ago. If false, returns created date value from database. Default: true.

Default value: array()

Return

(string)

Source

File: bp-groups/bp-groups-template.php

	function bp_get_group_date_created( $group = false, $args = array() ) {
		global $groups_template;

		$r = bp_parse_args( $args, array(
			'relative' => true,
		), 'group_date_created' );

		if ( empty( $group ) ) {
			$group =& $groups_template->group;
		}

		// We do not want relative time, so return now.
		// @todo Should the 'bp_get_group_date_created' filter be applied here?
		if ( ! $r['relative'] ) {
			return esc_attr( $group->date_created );
		}

		/**
		 * Filters the created date of the current group in the loop.
		 *
		 * @since BuddyPress 1.0.0
		 * @since BuddyPress 2.5.0 Added the `$group` parameter.
		 *
		 * @param string $value Created date for the current group.
		 * @param object $group Group object.
		 */
		return apply_filters( 'bp_get_group_date_created', bp_core_time_since( $group->date_created ), $group );
	}

Changelog

Changelog
Version Description
BuddyPress 2.7.0 Added $args as a parameter. BuddyPress 2.7.0 Added $args as a parameter.
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.