bp_get_group_date_created

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

Description

(string) bp_get_group_date_created( (constant) $group = false, (array) $args = array() ); 

Returns (string)

Parameters (2)

0. $group — Optional. (constant) => false
Group object. Default: current group in loop.
1. $args — Optional. (array) => array()
Array of optional parameters.

Options

    ;        


    Usage

    1. if ( !function_exists( 'bp_get_group_date_created' ) ) { 
    2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
    3.  
    4. // Optional. Group object. Default: current group in loop. 
    5. $group = false; 
    6.  
    7. // Array of optional parameters. 
    8. $args = array(); 
    9.  
    10. // NOTICE! Understand what this does before running. 
    11. $result = bp_get_group_date_created($group, $args); 
    12.  

    Defined (1)

    The function is defined in the following location(s).

    /bp-groups/bp-groups-template.php  
    1. function bp_get_group_date_created( $group = false, $args = array() ) { 
    2. global $groups_template; 
    3.  
    4. $r = wp_parse_args( $args, array( 
    5. 'relative' => true,  
    6. ) ); 
    7.  
    8. if ( empty( $group ) ) { 
    9. $group =& $groups_template->group; 
    10.  
    11. // We do not want relative time, so return now. 
    12. // @todo Should the 'bp_get_group_date_created' filter be applied here? 
    13. if ( ! $r['relative'] ) { 
    14. return esc_attr( $group->date_created ); 
    15.  
    16. /** 
    17. * Filters the created date of the current group in the loop. 
    18. * @since 1.0.0 
    19. * @since 2.5.0 Added the `$group` parameter. 
    20. * @param string $value Created date for the current group. 
    21. * @param object $group Group object. 
    22. */ 
    23. return apply_filters( 'bp_get_group_date_created', bp_core_time_since( $group->date_created ), $group );