Warnings::render_notice( string $message, string $type = 'info', string $depends_on = '', string $condition = '', array $additionalClasses = array() )
Render the notice block.
Contents
Parameters
- $message
-
(string) (Required) The message to show.
- $type
-
(string) (Optional) Type of message. Default is 'info'.
Default value: 'info'
- $depends_on
-
(string) (Optional) Dependency selector. Default is empty.
Default value: ''
- $condition
-
(string) (Optional) Dependency condition like 'checked' | 'not-checked' | 'numeric'. Default is empty.
Default value: ''
- $additionalClasses
-
(array) (Optional) Additional CSS classes to add to the notice block. Default is an empty array.
Default value: array()
Source
File: src/Tribe/Editor/Warnings.php
public function render_notice( $message, $type = 'info', $depends_on = '', $condition = '' ) {
$icon = 'dashicons-' . $type;
$has_dependency = empty( $depends_on ) ? '' : 'tribe-dependent';
$classes = $type . ' ' . $has_dependency;
$condition_attr = empty( $condition ) ? '' : 'data-condition-is-' . $condition;
?>
<div class="ticket-editor-notice <?php echo esc_attr( $classes ); ?>"
<?php if ( $depends_on ) { ?>
data-depends="<?php echo esc_attr( $depends_on ); ?>"
<?php } ?>
<?php echo esc_attr( $condition_attr ); ?>
>
<span class="dashicons <?php echo esc_attr( $icon ); ?>"></span>
<span class="message"><?php echo wp_kses_post( $message ); ?></span>
</div>
<?php
}
Changelog
| Version | Description |
|---|---|
| 5.6.2 | added the $additionalClasses attribute to allow customizing the notice. |
| 5.0.4 | Introduced. |