wc_get_notice_data_attr( array $notice )
Get notice data attribute.
Description Description
Parameters Parameters
- $notice
-
(Required) Notice data.
Return Return
(string)
Source Source
File: includes/wc-notice-functions.php
function wc_get_notice_data_attr( $notice ) { if ( empty( $notice['data'] ) ) { return; } $attr = ''; foreach ( $notice['data'] as $key => $value ) { $attr .= sprintf( ' data-%1$s="%2$s"', sanitize_title( $key ), esc_attr( $value ) ); } return $attr; }
Changelog Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |