bp_get_the_notification_action_links( array|string $args = '' )

Return the action links for the current notification.


Parameters Parameters

$args

(array|string) (Optional)

  • 'before'
    (string) HTML before the links.
  • 'after'
    (string) HTML after the links.
  • 'sep'
    (string) HTML between the links.
  • 'links'
    (array) Array of links to implode by 'sep'.
  • 'user_id'
    (int) User ID to fetch action links for. Defaults to displayed user ID.

Default value: ''


Top ↑

Return Return

(string) HTML links for actions to take on single notifications.


Source Source

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

	function bp_get_the_notification_action_links( $args = '' ) {
		// Set default user ID to use.
		$user_id = isset( $args['user_id'] ) ? $args['user_id'] : bp_displayed_user_id();

		// Parse.
		$r = wp_parse_args( $args, array(
			'before' => '',
			'after'  => '',
			'sep'    => ' | ',
			'links'  => array(
				bp_get_the_notification_mark_link( $user_id ),
				bp_get_the_notification_delete_link( $user_id )
			)
		) );

		// Build the links.
		$retval = $r['before'] . implode( $r['sep'], $r['links'] ) . $r['after'];

		/**
		 * Filters the action links for the current notification.
		 *
		 * @since 1.9.0
		 * @since 2.6.0 Added the `$r` parameter.
		 *
		 * @param string $retval HTML links for actions to take on single notifications.
		 * @param array  $r      Array of parsed arguments.
		 */
		return apply_filters( 'bp_get_the_notification_action_links', $retval, $r );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Added $user_id as a parameter to $args.
1.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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