Changeset 11008 for trunk/src/bp-groups/bp-groups-template.php
- Timestamp:
- 08/10/2016 12:55:49 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-template.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-template.php
r10904 r11008 685 685 * 686 686 * @since 1.0.0 687 * 688 * @param object|bool $group Optional. Group object. 689 * Default: current group in loop. 690 */ 691 function bp_group_last_active( $group = false ) { 692 echo bp_get_group_last_active( $group ); 687 * @since 2.7.0 Added $args as a parameter. 688 * 689 * @param object|bool $group Optional. Group object. Default: current group in loop. 690 * @param array|string $args Optional. {@see bp_get_group_last_active()}. 691 */ 692 function bp_group_last_active( $group = false, $args = array() ) { 693 echo bp_get_group_last_active( $group, $args ); 693 694 } 694 695 /** … … 696 697 * 697 698 * @since 1.0.0 698 * 699 * @param object|bool $group Optional. Group object. 700 * Default: current group in loop. 699 * @since 2.7.0 Added $args as a parameter. 700 * 701 * @param object|bool $group Optional. Group object. Default: current group in loop. 702 * @param array|string $args { 703 * Array of optional parameters. 704 * 705 * @type bool $relative Optional. If true, returns relative activity date. eg. active 5 months ago. 706 * If false, returns active date value from database. Default: true. 707 * } 701 708 * @return string 702 709 */ 703 function bp_get_group_last_active( $group = false ) {710 function bp_get_group_last_active( $group = false, $args = array() ) { 704 711 global $groups_template; 705 712 … … 708 715 } 709 716 717 $r = wp_parse_args( $args, array( 718 'relative' => true, 719 ) ); 720 710 721 $last_active = $group->last_activity; 711 712 if ( !$last_active ) { 722 if ( ! $last_active ) { 713 723 $last_active = groups_get_groupmeta( $group->id, 'last_activity' ); 724 } 725 726 // We do not want relative time, so return now. 727 // @todo Should the 'bp_get_group_last_active' filter be applied here? 728 if ( ! $r['relative'] ) { 729 return esc_attr( $last_active ); 714 730 } 715 731 … … 719 735 720 736 /** 721 * Filters the 'last active' string for the current g orup in the loop.737 * Filters the 'last active' string for the current group in the loop. 722 738 * 723 739 * @since 1.0.0 … … 1053 1069 * 1054 1070 * @since 1.0.0 1055 * 1056 * @param object|bool $group Optional. Group object. 1057 * Default: current group in loop. 1058 */ 1059 function bp_group_date_created( $group = false ) { 1060 echo bp_get_group_date_created( $group ); 1071 * @since 2.7.0 Added $args as a parameter. 1072 * 1073 * @param object|bool $group Optional. Group object. Default: current group in loop. 1074 * @param array|string $args {@see bp_get_group_date_created()}. 1075 */ 1076 function bp_group_date_created( $group = false, $args = array() ) { 1077 echo bp_get_group_date_created( $group, $args ); 1061 1078 } 1062 1079 /** … … 1064 1081 * 1065 1082 * @since 1.0.0 1066 * 1067 * @param object|bool $group Optional. Group object. 1068 * Default: current group in loop. 1083 * @since 2.7.0 Added $args as a parameter. 1084 * 1085 * @param object|bool $group Optional. Group object. Default: current group in loop. 1086 * @param array|string $args { 1087 * Array of optional parameters. 1088 * 1089 * @type bool $relative Optional. If true, returns relative created date. eg. active 5 months ago. 1090 * If false, returns created date value from database. Default: true. 1091 * } 1069 1092 * @return string 1070 1093 */ 1071 function bp_get_group_date_created( $group = false ) {1094 function bp_get_group_date_created( $group = false, $args = array() ) { 1072 1095 global $groups_template; 1096 1097 $r = wp_parse_args( $args, array( 1098 'relative' => true, 1099 ) ); 1073 1100 1074 1101 if ( empty( $group ) ) { 1075 1102 $group =& $groups_template->group; 1103 } 1104 1105 // We do not want relative time, so return now. 1106 // @todo Should the 'bp_get_group_date_created' filter be applied here? 1107 if ( ! $r['relative'] ) { 1108 return esc_attr( $group->date_created ); 1076 1109 } 1077 1110 … … 3971 4004 3972 4005 /** 3973 * @since 1.0.0 3974 */ 3975 function bp_group_member_joined_since() { 3976 echo bp_get_group_member_joined_since(); 3977 } 3978 3979 /** 4006 * Output the joined date for the current member in the group member loop. 4007 * 4008 * @since 1.0.0 4009 * @since 2.7.0 Added $args as a parameter. 4010 * 4011 * @param array|string $args {@see bp_get_group_member_joined_since()} 4012 * @return string 4013 */ 4014 function bp_group_member_joined_since( $args = array() ) { 4015 echo bp_get_group_member_joined_since( $args ); 4016 } 4017 /** 4018 * Return the joined date for the current member in the group member loop. 4019 * 3980 4020 * @since 1.0.0 3981 * 3982 * @return mixed|void 3983 */ 3984 function bp_get_group_member_joined_since() { 4021 * @since 2.7.0 Added $args as a parameter. 4022 * 4023 * @param array|string $args { 4024 * Array of optional parameters. 4025 * 4026 * @type bool $relative Optional. If true, returns relative joined date. eg. joined 5 months ago. 4027 * If false, returns joined date value from database. Default: true. 4028 * } 4029 * @return string 4030 */ 4031 function bp_get_group_member_joined_since( $args = array() ) { 3985 4032 global $members_template; 4033 4034 $r = wp_parse_args( $args, array( 4035 'relative' => true, 4036 ) ); 4037 4038 // We do not want relative time, so return now. 4039 // @todo Should the 'bp_get_group_member_joined_since' filter be applied here? 4040 if ( ! $r['relative'] ) { 4041 return esc_attr( $members_template->member->date_modified ); 4042 } 3986 4043 3987 4044 /**
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)