bp_get_activity_action( array $args = array() )

Return the activity action.

Description

Parameters

$args

(Optional)

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

Default value: array()

Return

(string) The activity action.

Source

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

1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
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 BuddyPress 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 BuddyPress 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
    ) );
}

Changelog

Changelog
Version Description
BuddyPress 1.2.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.