HEX
Server: Apache
System: Linux clpupre 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64
User: undanet (1000)
PHP: 7.4.3
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/undanet/www/wp-content/plugins/popup-maker/includes/functions/themes/template.php
<?php
/*******************************************************************************
 * Copyright (c) 2019, Code Atlantic LLC
 ******************************************************************************/

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

/**
 * @param $theme_id
 *
 * @return string
 */
function pum_get_rendered_theme_styles( $theme_id ) {
	$styles = '';

	$theme = pum_get_theme( $theme_id );

	if ( ! pum_is_theme( $theme ) ) {
		return '';
	}

	$slug = $theme->post_name;

	$theme_styles = $theme->get_generated_styles();

	if ( empty( $theme_styles ) ) {
		return $styles;
	}

	foreach ( $theme_styles as $element => $element_rules ) {
		switch ( $element ) {

			case 'overlay':
				$css_selector = ".pum-theme-{$theme_id}";
				if ( $slug ) {
					$css_selector .= ", .pum-theme-{$slug}";
				}
				break;

			case 'container':
				$css_selector = ".pum-theme-{$theme_id} .pum-container";
				if ( $slug ) {
					$css_selector .= ", .pum-theme-{$slug} .pum-container";
				}
				break;

			case 'close':
				$css_selector       = ".pum-theme-{$theme_id} .pum-content + .pum-close";
				$admin_bar_selector = "body.admin-bar .pum-theme-{$theme_id} .pum-content + .pum-close";
				if ( $slug ) {
					$css_selector       .= ", .pum-theme-{$slug} .pum-content + .pum-close";
					$admin_bar_selector .= ", body.admin-bar .pum-theme-{$slug} .pum-content + .pum-close";
				}
				break;

			default:
				$css_selector = ".pum-theme-{$theme_id} .pum-{$element}";
				if ( $slug ) {
					$css_selector .= ", .pum-theme-{$slug} .pum-{$element}";
				}
				break;

		}

		$rule_set = $sep = '';
		foreach ( $element_rules as $property => $value ) {
			if ( ! empty( $value ) ) {
				$rule_set .= $sep . $property . ': ' . $value;
				$sep       = '; ';
			}
		}

		$styles .= "$css_selector { $rule_set } \r\n";

		if ( $element === 'close' && ! empty( $admin_bar_selector ) && $theme->get_setting( 'close_position_outside' ) && strpos( $theme->get_setting( 'close_location' ), 'top' ) !== false ) {
			$top = ! empty( $element_rules['top'] ) ? (int) str_replace( 'px', '', $element_rules['top'] ) : 0;
			// Move it down to compensate for admin bar height.
			$top    += 32;
			$styles .= "$admin_bar_selector { top: {$top}px }";
		}
	}

	return $styles;
}