Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wpforms-.../src/Admin/Settings
File: Email.php
* @since 1.8.6
[500] Fix | Delete
*
[501] Fix | Delete
* @param bool $is_dark_mode Whether the color scheme is for dark mode.
[502] Fix | Delete
*
[503] Fix | Delete
* @return array
[504] Fix | Delete
*/
[505] Fix | Delete
private function get_color_scheme_controls( $is_dark_mode = false ) {
[506] Fix | Delete
[507] Fix | Delete
// Append '_dark' to keys if it's for dark mode.
[508] Fix | Delete
$is_dark_mode_suffix = $is_dark_mode ? '_dark' : '';
[509] Fix | Delete
[510] Fix | Delete
// Data attributes to disable extensions from appearing in the input field.
[511] Fix | Delete
$color_scheme_data = [
[512] Fix | Delete
'1p-ignore' => 'true', // 1Password ignore.
[513] Fix | Delete
'lp-ignore' => 'true', // LastPass ignore.
[514] Fix | Delete
];
[515] Fix | Delete
[516] Fix | Delete
$colors = [];
[517] Fix | Delete
$controls = [
[518] Fix | Delete
"email_background_color{$is_dark_mode_suffix}" => esc_html__( 'Background', 'wpforms-lite' ),
[519] Fix | Delete
"email_body_color{$is_dark_mode_suffix}" => esc_html__( 'Body', 'wpforms-lite' ),
[520] Fix | Delete
"email_text_color{$is_dark_mode_suffix}" => esc_html__( 'Text', 'wpforms-lite' ),
[521] Fix | Delete
"email_links_color{$is_dark_mode_suffix}" => esc_html__( 'Links', 'wpforms-lite' ),
[522] Fix | Delete
];
[523] Fix | Delete
[524] Fix | Delete
foreach ( $controls as $key => $label ) {
[525] Fix | Delete
// Construct the color controls array.
[526] Fix | Delete
$colors[ $key ] = [
[527] Fix | Delete
'name' => $label,
[528] Fix | Delete
'data' => array_merge(
[529] Fix | Delete
[
[530] Fix | Delete
'fallback-color' => $this->style_overrides[ $key ],
[531] Fix | Delete
],
[532] Fix | Delete
$color_scheme_data
[533] Fix | Delete
),
[534] Fix | Delete
];
[535] Fix | Delete
}
[536] Fix | Delete
[537] Fix | Delete
return $colors;
[538] Fix | Delete
}
[539] Fix | Delete
[540] Fix | Delete
/**
[541] Fix | Delete
* Get current email template hyperlink.
[542] Fix | Delete
*
[543] Fix | Delete
* @since 1.8.5
[544] Fix | Delete
*
[545] Fix | Delete
* @return string
[546] Fix | Delete
*/
[547] Fix | Delete
private function get_current_template_preview_link() {
[548] Fix | Delete
[549] Fix | Delete
// Leave if the user has the legacy template is set or the user doesn't have the capability.
[550] Fix | Delete
if ( ! wpforms_current_user_can() || Helpers::is_legacy_html_template() ) {
[551] Fix | Delete
return '';
[552] Fix | Delete
}
[553] Fix | Delete
[554] Fix | Delete
$template_name = Helpers::get_current_template_name();
[555] Fix | Delete
$current_template = Notifications::get_available_templates( $template_name );
[556] Fix | Delete
[557] Fix | Delete
// Return empty string if the current template is not found.
[558] Fix | Delete
// Leave early if the preview link is empty.
[559] Fix | Delete
if ( ! isset( $current_template['path'] ) || ! class_exists( $current_template['path'] ) || empty( $current_template['preview'] ) ) {
[560] Fix | Delete
return '';
[561] Fix | Delete
}
[562] Fix | Delete
[563] Fix | Delete
return sprintf(
[564] Fix | Delete
wp_kses( /* translators: %1$s - Email template preview URL. */
[565] Fix | Delete
__( '<a href="%1$s" class="wpforms-btn-preview" target="_blank" rel="noopener">Preview Email Template</a>', 'wpforms-lite' ),
[566] Fix | Delete
[
[567] Fix | Delete
'a' => [
[568] Fix | Delete
'class' => true,
[569] Fix | Delete
'href' => true,
[570] Fix | Delete
'target' => true,
[571] Fix | Delete
'rel' => true,
[572] Fix | Delete
],
[573] Fix | Delete
]
[574] Fix | Delete
),
[575] Fix | Delete
esc_url( $current_template['preview'] )
[576] Fix | Delete
);
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
/**
[580] Fix | Delete
* Maybe add the background color control to the email settings.
[581] Fix | Delete
* This is only available in the free version.
[582] Fix | Delete
*
[583] Fix | Delete
* @since 1.8.5
[584] Fix | Delete
*
[585] Fix | Delete
* @param array $settings Email settings.
[586] Fix | Delete
*
[587] Fix | Delete
* @return array
[588] Fix | Delete
*/
[589] Fix | Delete
private function maybe_add_background_color_control( $settings ) {
[590] Fix | Delete
[591] Fix | Delete
// Leave as is if the Pro version is active and no legacy template available.
[592] Fix | Delete
if ( ! Helpers::is_legacy_html_template() && wpforms()->is_pro() ) {
[593] Fix | Delete
return $settings;
[594] Fix | Delete
}
[595] Fix | Delete
[596] Fix | Delete
// Add the background color control after the header image.
[597] Fix | Delete
return wpforms_array_insert(
[598] Fix | Delete
$settings,
[599] Fix | Delete
[
[600] Fix | Delete
'email-background-color' => [
[601] Fix | Delete
'id' => 'email-background-color',
[602] Fix | Delete
'name' => esc_html__( 'Background Color', 'wpforms-lite' ),
[603] Fix | Delete
'desc' => esc_html__( 'Customize the background color of the email template.', 'wpforms-lite' ),
[604] Fix | Delete
'class' => [ 'email-background-color', 'has-preview-changes', 'email-light-mode' ],
[605] Fix | Delete
'type' => 'color',
[606] Fix | Delete
'is_hidden' => $this->plain_text,
[607] Fix | Delete
'default' => '#e9eaec',
[608] Fix | Delete
'data' => [
[609] Fix | Delete
'fallback-color' => $this->style_overrides['email_background_color'],
[610] Fix | Delete
'1p-ignore' => 'true', // 1Password ignore.
[611] Fix | Delete
'lp-ignore' => 'true', // LastPass ignore.
[612] Fix | Delete
],
[613] Fix | Delete
],
[614] Fix | Delete
],
[615] Fix | Delete
'email-color-scheme',
[616] Fix | Delete
'before'
[617] Fix | Delete
);
[618] Fix | Delete
}
[619] Fix | Delete
[620] Fix | Delete
/**
[621] Fix | Delete
* Gets the class for the header image control.
[622] Fix | Delete
*
[623] Fix | Delete
* This is used to determine if the header image is external.
[624] Fix | Delete
* Legacy header image control was allowing external URLs.
[625] Fix | Delete
*
[626] Fix | Delete
* Note that this evaluation is only available for the "Light" mode,
[627] Fix | Delete
* as the "Dark" mode is a new feature and doesn't have the legacy header image control.
[628] Fix | Delete
*
[629] Fix | Delete
* @since 1.8.5
[630] Fix | Delete
*
[631] Fix | Delete
* @return string
[632] Fix | Delete
*/
[633] Fix | Delete
private function get_external_header_image_class() {
[634] Fix | Delete
[635] Fix | Delete
$header_image_url = wpforms_setting( 'email-header-image', '' );
[636] Fix | Delete
[637] Fix | Delete
// If the header image URL is empty, return an empty string.
[638] Fix | Delete
if ( empty( $header_image_url ) ) {
[639] Fix | Delete
return '';
[640] Fix | Delete
}
[641] Fix | Delete
[642] Fix | Delete
$site_url = home_url(); // Get the current site's URL.
[643] Fix | Delete
[644] Fix | Delete
// Get the hosts of the site URL and the header image URL.
[645] Fix | Delete
$site_url_host = wp_parse_url( $site_url, PHP_URL_HOST );
[646] Fix | Delete
$header_image_url_host = wp_parse_url( $header_image_url, PHP_URL_HOST );
[647] Fix | Delete
[648] Fix | Delete
// Check if the header image URL host is different from the site URL host.
[649] Fix | Delete
if ( $header_image_url_host && $site_url_host && $header_image_url_host !== $site_url_host ) {
[650] Fix | Delete
return 'has-external-image-url';
[651] Fix | Delete
}
[652] Fix | Delete
[653] Fix | Delete
return ''; // If none of the conditions match, return an empty string.
[654] Fix | Delete
}
[655] Fix | Delete
[656] Fix | Delete
/**
[657] Fix | Delete
* Determine if the current page is the "Email" settings page.
[658] Fix | Delete
*
[659] Fix | Delete
* @since 1.8.5
[660] Fix | Delete
*
[661] Fix | Delete
* @return bool
[662] Fix | Delete
*/
[663] Fix | Delete
private function is_settings_page() {
[664] Fix | Delete
[665] Fix | Delete
return wpforms_is_admin_page( 'settings', 'email' );
[666] Fix | Delete
}
[667] Fix | Delete
}
[668] Fix | Delete
[669] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function