bp_nouveau_notifications_dashiconified_link( string $link = '', string $bp_tooltip = '', string $dashicon = '' )

Add a dashicon to Notifications action links


Parameters Parameters

$link

(string) (Optional) The action link.

Default value: ''

$bp_tooltip

(string) (Optional) The data-bp-attribute of the link.

Default value: ''

$aria_label

(string) (Required) The aria-label attribute of the link.

$dashicon

(string) (Optional) The dashicon class.

Default value: ''


Top ↑

Return Return

(string) Link Output.


Source Source

File: bp-templates/bp-nouveau/includes/notifications/functions.php

function bp_nouveau_notifications_dashiconified_link( $link = '', $bp_tooltip = '', $dashicon = '' ) {
	preg_match( '/<a\s[^>]*>(.*)<\/a>/siU', $link, $match );

	if ( ! empty( $match[0] ) && ! empty( $match[1] ) && ! empty( $dashicon ) && ! empty( $bp_tooltip ) ) {
		$link = str_replace(
			'>' . $match[1] . '<',
			sprintf(
				' class="bp-tooltip" data-bp-tooltip="%1$s"><span class="dashicons %2$s" aria-hidden="true"></span><span class="bp-screen-reader-text">%3$s</span><',
				esc_attr( $bp_tooltip ),
				sanitize_html_class( $dashicon ),
				$match[1]
			),
			$match[0]
		);
	}

	return $link;
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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