# firebox/1.0.14/Inc/Core/Layouts/public/closebutton.php

FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin &amp; Cart Abandonment, version 1.0.14. 71 lines.

- Page: https://pluginprobe.com/plugins/firebox/1.0.14/code/Inc/Core/Layouts/public/closebutton.php
- Raw: https://pluginprobe.com/plugins/firebox/1.0.14/raw/Inc/Core/Layouts/public/closebutton.php
- Modified: 2022-05-26T17:28:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/firebox/1.0.14/code/Inc/Core/Layouts/public/closebutton.php#L10-L20`.

```php
<?php
/**
 * @package         FireBox
 * @version         1.0.14 Free
 * 
 * @author          FirePlugins <info@fireplugins.com>
 * @link            https://www.fireplugins.com
 * @copyright       Copyright © 2022 FirePlugins All Rights Reserved
 * @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/

if (!defined('ABSPATH'))
{
	exit; // Exit if accessed directly.
}
$box = $this->data->get('box');
$btnSource = is_string($this->data->get('box.params.data.closebutton.source', 'icon')) ? $this->data->get('box.params.data.closebutton.source', 'icon') : 'icon';
$color     = is_string($this->data->get('box.params.data.closebutton.color', null)) ? $this->data->get('box.params.data.closebutton.color', null) : null;
$size      = is_string($this->data->get('box.params.data.closebutton.size', null)) || is_int($this->data->get('box.params.data.closebutton.size', null)) ? (int) $this->data->get('box.params.data.closebutton.size', null) : null;
$cbStyles  = '';
$styles    = '';

if ($btnSource == 'icon')
{
	$cbStyles = implode(';', array_filter(array(
		$color ? 'color:' . $color : null,
		$size ? 'font-size:' . $size . 'px' : null
	)));
}

// Delay the display of the close button using CSS animation
$delay = (float) $this->data->get('box.params.data.closebutton.delay', 0);
if ($delay > 0)
{
	$styles .= '
		.fb-' . $box->ID . ' .fb-close {
			visibility: hidden;
		}

		.fb-' . $box->ID . '.fb-visible .fb-close {
			animation: ' . $delay . 's ebFadeIn;
			animation-fill-mode: forwards;
		}
	';
}

// Add the hover color
if ($hoverColor = $this->data->get('box.params.data.closebutton.hover', null))
{
	$styles .= '
		.fb-' . esc_attr($box->ID) . ' .fb-close:hover {
			color: ' . esc_attr($hoverColor) . ' !important;
		}	
	';
}

if (!empty($styles))
{
    add_action( 'wp_footer', function() use ($styles) {
        echo '<style type="text/css">' . esc_attr($styles) . '</style>';
    }, 100);
}

?>
<button type="button" data-fbox-cmd="close" class="fb-close" aria-label="Close" style="<?php echo esc_attr($cbStyles); ?>">
	<?php if ($btnSource == "image") { ?>
		<img src="<?php echo esc_url($this->data->get('box.params.data.closebutton.image')); ?>"/>
	<?php } else { ?>
		<span aria-hidden="true">&times;</span>
	<?php } ?>
</button>
```
