bp_nouveau_notifications_dashiconified_link( string $link = '', string $bp_tooltip = '', string $dashicon = '' )
Add a dashicon to Notifications action links
Description
Parameters
- $link
-
(Optional) The action link.
Default value: ''
- $bp_tooltip
-
(Optional) The data-bp-attribute of the link.
Default value: ''
- $aria_label
-
(Required) The aria-label attribute of the link.
- $dashicon
-
(Optional) The dashicon class.
Default value: ''
Return
(string) Link Output.
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-pos="up" 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; }
Changelog
Version | Description |
---|---|
BuddyPress 3.0.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.