You appear to be a bot. Output may be restricted
Description
Create the notifications HTML with restore/dismiss button.
Usage
$string = _yoast_display_notifications( $notifications_list, $status );
Parameters
- $notifications_list
- ( array ) required – List of notifications.
- $status
- ( string ) required – Status of the notifications (active/dismissed).
Returns
string The output to render.
Source
File name: wordpress-seo/admin/views/partial-notifications-template.php
Lines:
1 to 36 of 36
function _yoast_display_notifications( $notifications_list, $status ) { $notifications = ''; foreach ( $notifications_list as $notification ) { switch ( $status ) { case 'active': $button = sprintf( '<button type="button" class="button dismiss"><span class="screen-reader-text">%1$s</span><span class="dashicons dashicons-hidden"></span></button>', esc_html__( 'Hide this item.', 'wordpress-seo' ) ); break; case 'dismissed': $button = sprintf( '<button type="button" class="button restore"><span class="screen-reader-text">%1$s</span><span class="dashicons yoast-svg-icon-eye"></span></button>', esc_html__( 'Show this item.', 'wordpress-seo' ) ); break; } $notifications .= sprintf( '<div class="yoast-notification-holder" id="%1$s" data-nonce="%2$s" data-json="%3$s">%4$s%5$s</div>', esc_attr( $notification->get_id() ), esc_attr( $notification->get_nonce() ), esc_attr( $notification->get_json() ), // This needs to be fixed in https://github.com/Yoast/wordpress-seo-premium/issues/2548. $notification, // Note: $button is properly escaped above. $button ); } return $notifications; }