| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.3/wp-content/plugins/wpforms-lite/src/Emails/Templates/ |
Upload File : |
<?php
namespace WPForms\Emails\Templates;
/**
* Email Summaries email template class.
*
* @since 1.5.4
*/
class Summary extends General {
/**
* Template slug.
*
* @since 1.5.4
*
* @var string
*/
const TEMPLATE_SLUG = 'summary';
/**
* Initialize class.
*
* @since 1.8.8
*
* @param string $message Optional. Message.
*/
public function __construct( $message = '' ) {
parent::__construct( $message );
// Maybe revert (override) the default background color value.
$this->set_args( $this->maybe_revert_background_color() );
}
/**
* Get header image URL from settings.
*
* @since 1.5.4
*
* @return array
*/
protected function get_header_image() {
$legacy_header_image = $this->maybe_revert_header_image();
// Bail early, if legacy behavior is enabled.
if ( ! empty( $legacy_header_image ) ) {
return $legacy_header_image;
}
// Set specific WPForms logo width in pixels for MS Outlook and old email clients.
return [
'url_light' => WPFORMS_PLUGIN_URL . 'assets/images/logo.png',
'url_dark' => WPFORMS_PLUGIN_URL . 'assets/images/logo-negative.png',
];
}
/**
* Checks if legacy header image overrides should be applied.
*
* @since 1.8.8
*
* @return array
*/
private function maybe_revert_header_image() {
/**
* This filter is designed to restore the legacy behavior, reverting the WPForms logo and template background color
* to values defined in the WPForms → Settings → Email tab.
*
* @since 1.8.8
*
* @param bool $revert_legacy_style_overrides Whether to apply legacy style overrides.
*/
if ( ! (bool) apply_filters( 'wpforms_emails_templates_summary_revert_legacy_style_overrides', false ) ) {
return [];
}
$header_image = wpforms_setting( 'email-header-image' );
// Bail early, if no custom header image if set.
if ( empty( $header_image ) ) {
return [];
}
return [ 'url_light' => esc_url( $header_image ) ];
}
/**
* Checks if legacy background color overrides should be applied.
*
* @since 1.8.8
*
* @return array
*/
private function maybe_revert_background_color() {
/**
* This filter is designed to restore the legacy behavior, reverting the WPForms logo and template background color
* to values defined in the WPForms → Settings → Email tab.
*
* @since 1.8.8
*
* @param bool $revert_legacy_style_overrides Whether to apply legacy style overrides.
*/
if ( ! (bool) apply_filters( 'wpforms_emails_templates_summary_revert_legacy_style_overrides', false ) ) {
return [ 'style' => [ 'email_background_color' => '' ] ];
}
return [
'style' => [
'email_background_color' => wpforms_setting( 'email-background-color', '#e9eaec' ),
],
];
}
}