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

1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
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.