bp_get_activity_action( array $args = array() )

Return the activity action.


Description Description


Parameters Parameters

$args

(Optional)

  • 'no_timestamp'
    (bool) Whether to exclude the timestamp.

Default value: array()


Top ↑

Return Return

(string) The activity action.


Top ↑

Source Source

File: bp-activity/bp-activity-template.php

	function bp_get_activity_action( $args = array() ) {
		global $activities_template;

		$r = wp_parse_args( $args, array(
			'no_timestamp' => false,
		) );

		/**
		 * Filters the activity action before the action is inserted as meta.
		 *
		 * @since 1.2.10
		 *
		 * @param array $value Array containing the current action, the current activity, and the $args array passed into the function.
		 */
		$action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array(
			$activities_template->activity->action,
			&$activities_template->activity,
			$r
		) );

		// Prepend the activity action meta (link, time since, etc...).
		if ( ! empty( $action ) && empty( $r['no_timestamp'] ) ) {
			$action = bp_insert_activity_meta( $action );
		}

		/**
		 * Filters the activity action after the action has been inserted as meta.
		 *
		 * @since 1.2.0
		 *
		 * @param array $value Array containing the current action, the current activity, and the $args array passed into the function.
		 */
		return apply_filters_ref_array( 'bp_get_activity_action', array(
			$action,
			&$activities_template->activity,
			$r
		) );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduce function parameter, $args.
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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