: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* This template can be overridden by copying it to your child_theme_folder/themify-builder/template-alert.php.
* Access original fields: $args['mod_settings']
defined( 'ABSPATH' ) || exit;
$mod_name=$args['mod_name'];
$element_id = $args['module_ID'];
$fields_args=$args['mod_settings']+ array(
'appearance_alert' => '',
'layout_alert' => 'button-right',
'color_alert' => 'tb_default_color',
'alert_button_action' => 'close',
'alert_message_text' => '',
'action_btn_link_alert' => '#',
'open_link_new_tab_alert' => '',
'lightbox_width_unit' => 'px',
'lightbox_height_unit' => 'px',
'action_btn_text_alert' => false,
'action_btn_color_alert' => 'tb_default_color',
'action_btn_appearance_alert' => '',
'alert_no_date_limit' => '',
'alert_limit_count' => '',
'alert_auto_close' => '',
'alert_auto_close_delay' => '',
if (!empty($fields_args['appearance_alert'])) {
$fields_args['appearance_alert'] = self::get_checkbox_data($fields_args['appearance_alert']);
Themify_Builder_Model::load_appearance_css($fields_args['appearance_alert']);
if (!empty($fields_args['action_btn_appearance_alert'])) {
$fields_args['action_btn_appearance_alert'] = self::get_checkbox_data($fields_args['action_btn_appearance_alert']);
Themify_Builder_Model::load_appearance_css($fields_args['action_btn_appearance_alert']);
Themify_Builder_Model::load_color_css($fields_args['color_alert']);
Themify_Builder_Model::load_color_css($fields_args['action_btn_color_alert']);
$container_class =apply_filters('themify_builder_module_classes', array(
$fields_args['layout_alert'],
$fields_args['color_alert'],
$fields_args['css_alert'],
$fields_args['appearance_alert']
), $mod_name, $element_id, $fields_args);
if(!empty($fields_args['global_styles']) && Themify_Builder::$frontedit_active===false){
$container_class[] = $fields_args['global_styles'];
$container_props = apply_filters('themify_builder_module_container_props', self::parse_animation_effect($fields_args,array(
'class' => implode(' ', $container_class),
'data-auto-close' => !empty($fields_args['alert_auto_close']) && !empty($fields_args['alert_auto_close_delay']) ? $fields_args['alert_auto_close_delay'] : '',
'data-module-id' => $element_id,
'data-alert-limit' => $fields_args['alert_limit_count'],
)), $fields_args, $mod_name, $element_id);
$ui_class=array('ui', 'builder_button', $fields_args['action_btn_appearance_alert'],$fields_args['action_btn_color_alert']);
if('url' !== $fields_args['alert_button_action'] ){
$ui_class[]='alert-close';
$url = $fields_args['alert_button_action'] === 'url' ? esc_url($fields_args['action_btn_link_alert']) : '#';
if ( $fields_args['alert_button_action'] === 'url' ) {
if ( 'yes' === $fields_args['open_link_new_tab_alert'] ) {
$button_attr .= ' rel="noopener" target="_blank"';
} else if ( 'lightbox' === $fields_args['open_link_new_tab_alert'] ) {
$ui_class[]= 'themify_lightbox';
if ( $fields_args['lightbox_width'] !== '' || $fields_args['lightbox_height'] !== '' ) {
$lightbox_settings = array();
$lightbox_settings[] = $fields_args['lightbox_width'] !== '' ? $fields_args['lightbox_width'] . $fields_args['lightbox_width_unit'] : '';
$lightbox_settings[] = $fields_args['lightbox_height'] !== '' ? $fields_args['lightbox_height'] . $fields_args['lightbox_height_unit'] : '';
$button_attr .= sprintf(' data-zoom-config="%s"', implode('|', $lightbox_settings));
if ($fields_args['alert_button_action'] === 'message' && !empty($fields_args['alert_message_text'])) {
$button_attr = ' data-alert-message="' . esc_attr($fields_args['alert_message_text']) . '"';
$is_alert_visible = true;
if (Themify_Builder::$frontedit_active===false) {
if (!empty($fields_args['alert_no_date_limit']) && (!empty($fields_args['alert_start_at']) || !empty($fields_args['alert_end_at']) )) {
if (!empty($fields_args['alert_start_at'])) {
$is_alert_visible = ( strtotime($fields_args['alert_start_at']) - $now ) < 0;
if ($is_alert_visible===true && !empty($fields_args['alert_end_at'])) {
$is_alert_visible = ( $now - strtotime($fields_args['alert_end_at']) ) < 0;
if ($is_alert_visible===true && !empty($fields_args['alert_show_to'])) {
if ($fields_args['alert_show_to'] === 'guest') {
$is_alert_visible = !is_user_logged_in();
elseif ($fields_args['alert_show_to'] === 'user') {
$is_alert_visible = is_user_logged_in();
if ($is_alert_visible===true && !empty($fields_args['alert_limit_count']) && isset($_COOKIE[$element_id])) {
$user_cookie = (int) $_COOKIE[ $element_id ];
if ( $user_cookie && $user_cookie >= $fields_args['alert_limit_count'] ) {
$is_alert_visible = false;
$container_props['data-lazy']=1;
if ($is_alert_visible===true):
$fields_args['title_tag'] = esc_attr( $fields_args['title_tag'] );
self::sticky_element_props($container_props,$fields_args);
<div <?php echo themify_get_element_attributes($container_props); ?>>
<?php $container_props=$container_class=$args=null;
echo Themify_Builder_Component_Module::get_module_title($fields_args,'mod_title_alert');
<div class="alert-inner">
<div class="alert-content">
<<?php echo $fields_args['title_tag'];?> class="alert-heading"><?php echo $fields_args['heading_alert'] ?></<?php echo $fields_args['title_tag'];?>>
<div class="tb_text_wrap">
<?php echo apply_filters('themify_builder_module_content', $fields_args['text_alert']);?>
<?php if ($fields_args['action_btn_text_alert']) : ?>
<div class="alert-button">
<a href="<?php echo $url; ?>" class="<?php echo implode(' ', $ui_class); ?>"<?php echo $button_attr; ?>>
<span class="tb_alert_text"><?php echo $fields_args['action_btn_text_alert'] ?></span>
<div class="alert-close tf_close"></div>