$args icon (override aafm_icon name), inline (bool), html (bool), * class (extra CSS class appended to the wrapper, sanitized * with sanitize_html_class()). * @return string */ function aafm_get_notice_html( string $variant, string $message, array $args = array() ): string { $icons = array( 'warning' => 'warning', 'info' => 'info', 'success' => 'success', 'error' => 'error', ); if ( ! isset( $icons[ $variant ] ) ) { $variant = 'info'; } $icon_name = isset( $args['icon'] ) ? (string) $args['icon'] : $icons[ $variant ]; $inline = empty( $args['inline'] ) ? '' : ' aafm-notice-inline'; $extra = empty( $args['class'] ) ? '' : ' ' . sanitize_html_class( (string) $args['class'] ); $body = empty( $args['html'] ) ? esc_html( $message ) : wp_kses_post( $message ); return sprintf( '