Changeset 6489
- Timestamp:
- 11/06/2012 02:41:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-template.php
r6483 r6489 1122 1122 * @since BuddyPress (1.2) 1123 1123 * 1124 * @param array $args See bp_get_activity_action() 1124 1125 * @uses bp_get_activity_action() 1125 1126 */ 1126 function bp_activity_action( ) {1127 echo bp_get_activity_action( );1127 function bp_activity_action( $args = array() ) { 1128 echo bp_get_activity_action( $args ); 1128 1129 } 1129 1130 … … 1134 1135 * 1135 1136 * @global object $activities_template {@link BP_Activity_Template} 1137 * @param array $args Only parameter is "no_timestamp". If true, timestamp is shown in output. 1136 1138 * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook 1137 1139 * @uses bp_insert_activity_meta() … … 1140 1142 * @return string The activity action 1141 1143 */ 1142 function bp_get_activity_action() { 1143 global $activities_template; 1144 function bp_get_activity_action( $args = array() ) { 1145 global $activities_template; 1146 1147 $defaults = array( 1148 'no_timestamp' => false, 1149 ); 1150 1151 $args = wp_parse_args( $args, $defaults ); 1152 extract( $args, EXTR_SKIP ); 1144 1153 1145 1154 $action = $activities_template->activity->action; 1146 $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity ) );1147 1148 if ( ! empty( $action ))1155 $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity, $args ) ); 1156 1157 if ( ! empty( $action ) && ! $no_timestamp ) 1149 1158 $action = bp_insert_activity_meta( $action ); 1150 1159 1151 return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity ) );1160 return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity, $args ) ); 1152 1161 } 1153 1162
Note: See TracChangeset
for help on using the changeset viewer.