171 $this->
id = sanitize_title(
$id );
177 if ( is_user_logged_in() ) {
178 $user_id = get_current_user_id();
179 $this->dismissed = get_user_meta( $user_id, self::USER_META_KEY_PERMANENT_DISMISS,
true );
190 private function dismissButton()
198 $classes = array(
'close' );
201 if ( !empty( $this->dismissToolTip ) ) {
202 $classes[] =
'wpdk-has-tooltip';
203 $title = sprintf(
'title="%s"', $this->dismissToolTip );
207 if(
true === $this->permanent_dismiss ) {
208 $classes[] =
'wpdk-alert-permanent-dismiss';
211 if ( $this->dismissButton ) {
215 class=
"<?php echo WPDKHTMLTag::classInline( $classes ) ?>"
217 data-dismiss=
"alert"><?php echo $this->dismiss_button_glyph ?></button>
232 private function _content()
256 private function _title()
258 if ( empty( $this->
title ) ) {
262 return empty( $this->
title ) ?
'' : sprintf(
'<h4>%s</h4>', $this->
title );
288 if ( !empty( $this->dismissed ) && in_array( $this->
id, $this->dismissed ) ) {
294 <?php echo empty( $this->
id ) ?
'' :
'id="' . $this->
id .
'"' ?>
295 <?php echo empty( $this->data ) ?
'' : self::dataInline( $this->data ) ?>
296 class=
"<?php echo self::classInline( $this->class, array(
299 $this->dismissable ? 'alert-dismissable' : '',
304 <?php echo $this->dismissButton() ?>
305 <?php echo $this->_title() ?>
306 <?php echo $this->_content() ?>
326 'alert_type' => $this->type,
327 'dismiss_button' => $this->dismissButton,
329 'title' => $this->
title,
331 return array( $item );
345 private function alert_block()
347 _deprecated_function( __CLASS__ .
'::' . __FUNCTION__,
'1.3.1 and Bootstrap 3.0.0',
'' );
348 return $this->block ?
'alert-block' :
'';
360 return $this->
html();