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/clone/wp-conte.../themes/Divi/includes/builder/module/field
File: TextShadow.php
[500] Fix | Delete
/**
[501] Fix | Delete
* Adds CSS rule.
[502] Fix | Delete
*
[503] Fix | Delete
* @since 3.23 Add responsive settings support to render tablet and phone styles.
[504] Fix | Delete
*
[505] Fix | Delete
* @param ET_Builder_Element $module Module object.
[506] Fix | Delete
* @param string $label Label.
[507] Fix | Delete
* @param array $font Field definition.
[508] Fix | Delete
* @param string $function_name Shortcode function.
[509] Fix | Delete
* @param bool $is_hover Hover status.
[510] Fix | Delete
* @param string $device Current active device.
[511] Fix | Delete
*
[512] Fix | Delete
* @return void
[513] Fix | Delete
*/
[514] Fix | Delete
public function update_styles( $module, $label, $font, $function_name, $is_hover = false, $device = 'desktop' ) {
[515] Fix | Delete
$utils = ET_Core_Data_Utils::instance();
[516] Fix | Delete
$all_values = $module->props;
[517] Fix | Delete
$main_element_selector = $module->main_css_element;
[518] Fix | Delete
$device = '' === $device ? 'desktop' : $device;
[519] Fix | Delete
[520] Fix | Delete
// Use a different selector for plugin
[521] Fix | Delete
$css_element = $this->is_plugin_active && isset( $font['css']['limited_main'] ) ? 'css.limited_main' : 'css.main';
[522] Fix | Delete
[523] Fix | Delete
// Use 'text_shadow' selector if defined, fallback to $css_element or default selector
[524] Fix | Delete
$selector = $utils->array_get( $font, 'css.text_shadow', $utils->array_get( $font, $css_element, $main_element_selector ) );
[525] Fix | Delete
$responsive_selector = $selector;
[526] Fix | Delete
[527] Fix | Delete
if ( $is_hover ) {
[528] Fix | Delete
if ( is_array( $selector ) ) {
[529] Fix | Delete
$selector = array_map( array( $this, 'add_hover_to_selectors' ), $selector );
[530] Fix | Delete
} else {
[531] Fix | Delete
$selector = et_pb_hover_options()->add_hover_to_selectors( $selector );
[532] Fix | Delete
}
[533] Fix | Delete
[534] Fix | Delete
$selector = $utils->array_get( $font, 'css.text_shadow_hover', $utils->array_get( $font, 'css.hover', $selector ) );
[535] Fix | Delete
}
[536] Fix | Delete
[537] Fix | Delete
// Get the text-shadow declaration (horizontal vertical blur color).
[538] Fix | Delete
$declaration = $this->get_declaration(
[539] Fix | Delete
$label,
[540] Fix | Delete
$this->get_important( $font, 'text-shadow' ),
[541] Fix | Delete
$all_values,
[542] Fix | Delete
$is_hover,
[543] Fix | Delete
$device
[544] Fix | Delete
);
[545] Fix | Delete
[546] Fix | Delete
// Do not provide hover style if it is the same as normal style
[547] Fix | Delete
if ( $is_hover ) {
[548] Fix | Delete
$normal = $this->get_declaration(
[549] Fix | Delete
$label,
[550] Fix | Delete
$this->get_important( $font, 'text-shadow' ),
[551] Fix | Delete
$all_values,
[552] Fix | Delete
false
[553] Fix | Delete
);
[554] Fix | Delete
[555] Fix | Delete
if ( $declaration === $normal ) {
[556] Fix | Delete
return;
[557] Fix | Delete
}
[558] Fix | Delete
}
[559] Fix | Delete
[560] Fix | Delete
// Media query.
[561] Fix | Delete
$media_query = array();
[562] Fix | Delete
if ( 'desktop' !== $device && ! $is_hover ) {
[563] Fix | Delete
$breakpoint = 'tablet' === $device ? 'max_width_980' : 'max_width_767';
[564] Fix | Delete
$media_query = array( 'media_query' => ET_Builder_Element::get_media_query( $breakpoint ) );
[565] Fix | Delete
}
[566] Fix | Delete
[567] Fix | Delete
if ( is_array( $selector ) ) {
[568] Fix | Delete
foreach ( $selector as $single_selector ) {
[569] Fix | Delete
ET_Builder_Element::set_style(
[570] Fix | Delete
$function_name, array_merge( array(
[571] Fix | Delete
'selector' => $single_selector,
[572] Fix | Delete
'declaration' => $declaration,
[573] Fix | Delete
'priority' => $module->get_style_priority(),
[574] Fix | Delete
), $media_query )
[575] Fix | Delete
);
[576] Fix | Delete
}
[577] Fix | Delete
} else {
[578] Fix | Delete
ET_Builder_Element::set_style(
[579] Fix | Delete
$function_name, array_merge( array(
[580] Fix | Delete
'selector' => $selector,
[581] Fix | Delete
'declaration' => $declaration,
[582] Fix | Delete
'priority' => $module->get_style_priority(),
[583] Fix | Delete
), $media_query )
[584] Fix | Delete
);
[585] Fix | Delete
}
[586] Fix | Delete
[587] Fix | Delete
}//end update_styles()
[588] Fix | Delete
[589] Fix | Delete
/**
[590] Fix | Delete
* Added to fix array_map can't access static class of Hover Options.
[591] Fix | Delete
*
[592] Fix | Delete
* @since 3.23
[593] Fix | Delete
*
[594] Fix | Delete
* @param string $selector Current selector.
[595] Fix | Delete
*
[596] Fix | Delete
* @return string Updated selector with hover suffix.
[597] Fix | Delete
*/
[598] Fix | Delete
private function add_hover_to_selectors( $selector ) {
[599] Fix | Delete
return et_pb_hover_options()->add_hover_to_selectors( $selector );
[600] Fix | Delete
}
[601] Fix | Delete
[602] Fix | Delete
/**
[603] Fix | Delete
* Process Text Shadow options and adds CSS rules.
[604] Fix | Delete
*
[605] Fix | Delete
* @param ET_Builder_Element $module Module object.
[606] Fix | Delete
* @param string $function_name Shortcode function.
[607] Fix | Delete
*
[608] Fix | Delete
* @return void
[609] Fix | Delete
*/
[610] Fix | Delete
public function process_advanced_css( $module, $function_name ) {
[611] Fix | Delete
$utils = ET_Core_Data_Utils::instance();
[612] Fix | Delete
$all_values = $module->props;
[613] Fix | Delete
$advanced_fields = $module->advanced_fields;
[614] Fix | Delete
[615] Fix | Delete
// Disable if module doesn't set advanced_fields property and has no VB support
[616] Fix | Delete
if ( ! $module->has_vb_support() && ! $module->has_advanced_fields ) {
[617] Fix | Delete
return;
[618] Fix | Delete
}
[619] Fix | Delete
[620] Fix | Delete
$suffixes = array( '', 'tablet', 'phone', et_pb_hover_options()->get_suffix() );
[621] Fix | Delete
[622] Fix | Delete
foreach ( $suffixes as $suffix ) {
[623] Fix | Delete
$is_hover = et_pb_hover_options()->get_suffix() === $suffix;
[624] Fix | Delete
[625] Fix | Delete
// Check for text shadow settings in font-options
[626] Fix | Delete
if ( ! empty( $advanced_fields['fonts'] ) ) {
[627] Fix | Delete
// We have a 'fonts' section, fetch its values
[628] Fix | Delete
foreach ( $advanced_fields['fonts'] as $label => $font ) {
[629] Fix | Delete
// label can be header / body / toggle / etc
[630] Fix | Delete
$shadow_style = "{$label}_text_shadow_style";
[631] Fix | Delete
[632] Fix | Delete
if ( 'none' !== $utils->array_get( $all_values, $shadow_style, 'none' ) ) {
[633] Fix | Delete
// We have a preset selected which isn't none, need to add text-shadow style
[634] Fix | Delete
$this->update_styles( $module, $label, $font, $function_name, $is_hover, $suffix, $label );
[635] Fix | Delete
}
[636] Fix | Delete
}
[637] Fix | Delete
}
[638] Fix | Delete
[639] Fix | Delete
// Check for text shadow settings in Advanced/Text toggle
[640] Fix | Delete
if ( isset( $advanced_fields['text'] ) && 'none' !== $utils->array_get( $all_values, 'text_shadow_style', 'none' ) ) {
[641] Fix | Delete
// We have a preset selected which isn't none, need to add text-shadow style
[642] Fix | Delete
$text = $advanced_fields['text'];
[643] Fix | Delete
$this->update_styles( $module, '', $text, $function_name, $is_hover, $suffix );
[644] Fix | Delete
}
[645] Fix | Delete
[646] Fix | Delete
// Check for text shadow settings in Advanced/Fields toggle
[647] Fix | Delete
if ( isset( $advanced_fields['fields'] ) && 'none' !== $utils->array_get( $all_values, 'fields_text_shadow_style', 'none' ) ) {
[648] Fix | Delete
// We have a preset selected which isn't none, need to add text-shadow style
[649] Fix | Delete
$fields = $advanced_fields['fields'];
[650] Fix | Delete
$this->update_styles( $module, 'fields', $fields, $function_name, $is_hover, $suffix );
[651] Fix | Delete
}
[652] Fix | Delete
[653] Fix | Delete
// Check for text shadow settings in Advanced/Button toggle
[654] Fix | Delete
if ( ! empty( $advanced_fields['button'] ) ) {
[655] Fix | Delete
// We have a 'button' section, fetch its values
[656] Fix | Delete
foreach ( $advanced_fields['button'] as $label => $button ) {
[657] Fix | Delete
// label can be header / body / toggle / etc
[658] Fix | Delete
$shadow_style = "{$label}_text_shadow_style";
[659] Fix | Delete
[660] Fix | Delete
if ( 'none' !== $utils->array_get( $all_values, $shadow_style, 'none' ) ) {
[661] Fix | Delete
// We have a preset selected which isn't none, need to add text-shadow style
[662] Fix | Delete
// Build a selector to only target the button
[663] Fix | Delete
$css_element = $utils->array_get( $button, 'css.main', "{$module->main_css_element} .et_pb_button" );
[664] Fix | Delete
// Make sure it has highest priority
[665] Fix | Delete
$utils->array_set( $button, 'css.text_shadow', $css_element );
[666] Fix | Delete
[667] Fix | Delete
if ( ! isset( $button['css.hover'] ) ) {
[668] Fix | Delete
$utils->array_set( $button, 'css.hover', et_pb_hover_options()->add_hover_to_selectors( $css_element ) );
[669] Fix | Delete
}
[670] Fix | Delete
[671] Fix | Delete
$this->update_styles( $module, $label, $button, $function_name, $is_hover, $suffix );
[672] Fix | Delete
}
[673] Fix | Delete
}
[674] Fix | Delete
}
[675] Fix | Delete
[676] Fix | Delete
// Check for text shadow settings in Advanced/Fields Input toggle
[677] Fix | Delete
if ( ! empty( $advanced_fields['form_field'] ) ) {
[678] Fix | Delete
// There are possibilities to have more than one field inputs.
[679] Fix | Delete
foreach ( $advanced_fields['form_field'] as $label => $form_field ) {
[680] Fix | Delete
// Ensure the text shadow style is selected before updating the styles.
[681] Fix | Delete
if ( 'none' !== $utils->array_get( $all_values, $label . '_text_shadow_style', 'none' ) ) {
[682] Fix | Delete
// Build a selector to only target the field input.
[683] Fix | Delete
$main_selector = isset( $form_field['css']['main'] ) ? $form_field['css']['main'] : "{$module->main_css_element} .input";
[684] Fix | Delete
$text_shadow_selector = isset( $form_field['css']['text_shadow'] ) ? $form_field['css']['text_shadow'] : $main_selector;
[685] Fix | Delete
$text_shadow_hover_selector = isset( $form_field['css']['text_shadow_hover'] ) ? $form_field['css']['text_shadow_hover'] : et_pb_hover_options()->add_hover_to_selectors( $text_shadow_selector );
[686] Fix | Delete
[687] Fix | Delete
// Make sure it has highest priority.
[688] Fix | Delete
$form_field['css']['text_shadow'] = $text_shadow_selector;
[689] Fix | Delete
$form_field['css']['text_shadow_hover'] = $text_shadow_hover_selector;
[690] Fix | Delete
[691] Fix | Delete
// Check and override important status.
[692] Fix | Delete
if ( ! empty( $form_field['css']['important'] ) ) {
[693] Fix | Delete
$form_field_important = $form_field['css']['important'];
[694] Fix | Delete
if ( ! empty( $form_field_important['font'] ) ) {
[695] Fix | Delete
$form_field['css']['important'] = $form_field_important['font'];
[696] Fix | Delete
}
[697] Fix | Delete
[698] Fix | Delete
if ( ! empty( $form_field_important['text_shadow'] ) ) {
[699] Fix | Delete
$form_field['css']['important'] = $form_field_important['text_shadow'];
[700] Fix | Delete
}
[701] Fix | Delete
}
[702] Fix | Delete
[703] Fix | Delete
$this->update_styles( $module, $label, $form_field, $function_name, $is_hover, $suffix );
[704] Fix | Delete
}
[705] Fix | Delete
}
[706] Fix | Delete
}
[707] Fix | Delete
}
[708] Fix | Delete
[709] Fix | Delete
}//end process_advanced_css()
[710] Fix | Delete
[711] Fix | Delete
}
[712] Fix | Delete
[713] Fix | Delete
return new ET_Builder_Module_Field_TextShadow();
[714] Fix | Delete
[715] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function