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

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


Parameters Parameters

$group

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

Default value: false

$args

(array|string) (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()


Top ↑

Return Return

(string)


Source 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 1.0.0
		 * @since 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 );
	}


Top ↑

Changelog Changelog

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

Top ↑

User Contributed Notes User Contributed Notes

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