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
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/module
File: FullwidthImage.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Fullwidth_Image extends ET_Builder_Module {
[2] Fix | Delete
function init() {
[3] Fix | Delete
$this->name = esc_html__( 'Fullwidth Image', 'et_builder' );
[4] Fix | Delete
$this->plural = esc_html__( 'Fullwidth Images', 'et_builder' );
[5] Fix | Delete
$this->slug = 'et_pb_fullwidth_image';
[6] Fix | Delete
$this->vb_support = 'on';
[7] Fix | Delete
$this->fullwidth = true;
[8] Fix | Delete
$this->defaults = array(
[9] Fix | Delete
'align' => 'left',
[10] Fix | Delete
);
[11] Fix | Delete
[12] Fix | Delete
$this->settings_modal_toggles = array(
[13] Fix | Delete
'general' => array(
[14] Fix | Delete
'toggles' => array(
[15] Fix | Delete
'main_content' => et_builder_i18n( 'Image' ),
[16] Fix | Delete
'link' => et_builder_i18n( 'Link' ),
[17] Fix | Delete
),
[18] Fix | Delete
),
[19] Fix | Delete
'advanced' => array(
[20] Fix | Delete
'toggles' => array(
[21] Fix | Delete
'overlay' => et_builder_i18n( 'Overlay' ),
[22] Fix | Delete
),
[23] Fix | Delete
),
[24] Fix | Delete
'custom_css' => array(
[25] Fix | Delete
'toggles' => array(
[26] Fix | Delete
'animation' => array(
[27] Fix | Delete
'title' => esc_html__( 'Animation', 'et_builder' ),
[28] Fix | Delete
'priority' => 90,
[29] Fix | Delete
),
[30] Fix | Delete
'attributes' => array(
[31] Fix | Delete
'title' => esc_html__( 'Attributes', 'et_builder' ),
[32] Fix | Delete
'priority' => 95,
[33] Fix | Delete
),
[34] Fix | Delete
),
[35] Fix | Delete
),
[36] Fix | Delete
);
[37] Fix | Delete
[38] Fix | Delete
$this->advanced_fields = array(
[39] Fix | Delete
'margin_padding' => array(
[40] Fix | Delete
'css' => array(
[41] Fix | Delete
'important' => 'all',
[42] Fix | Delete
),
[43] Fix | Delete
),
[44] Fix | Delete
'box_shadow' => array(
[45] Fix | Delete
'default' => array(
[46] Fix | Delete
'css' => array(
[47] Fix | Delete
'overlay' => 'inset',
[48] Fix | Delete
),
[49] Fix | Delete
),
[50] Fix | Delete
),
[51] Fix | Delete
'fonts' => false,
[52] Fix | Delete
'text' => false,
[53] Fix | Delete
'button' => false,
[54] Fix | Delete
'link_options' => false,
[55] Fix | Delete
'position_fields' => array(
[56] Fix | Delete
'default' => 'relative',
[57] Fix | Delete
),
[58] Fix | Delete
);
[59] Fix | Delete
[60] Fix | Delete
$this->help_videos = array(
[61] Fix | Delete
array(
[62] Fix | Delete
'id' => 'cYwqxoHnjNA',
[63] Fix | Delete
'name' => esc_html__( 'An introduction to the Fullwidth Image module', 'et_builder' ),
[64] Fix | Delete
),
[65] Fix | Delete
);
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
function get_fields() {
[69] Fix | Delete
$fields = array(
[70] Fix | Delete
'src' => array(
[71] Fix | Delete
'label' => et_builder_i18n( 'Image' ),
[72] Fix | Delete
'type' => 'upload',
[73] Fix | Delete
'option_category' => 'basic_option',
[74] Fix | Delete
'upload_button_text' => et_builder_i18n( 'Upload an image' ),
[75] Fix | Delete
'choose_text' => esc_attr__( 'Choose an Image', 'et_builder' ),
[76] Fix | Delete
'update_text' => esc_attr__( 'Set As Image', 'et_builder' ),
[77] Fix | Delete
'affects' => array(
[78] Fix | Delete
'alt',
[79] Fix | Delete
'title_text',
[80] Fix | Delete
),
[81] Fix | Delete
'description' => esc_html__( 'Upload your desired image, or type in the URL to the image you would like to display.', 'et_builder' ),
[82] Fix | Delete
'toggle_slug' => 'main_content',
[83] Fix | Delete
'dynamic_content' => 'image',
[84] Fix | Delete
'mobile_options' => true,
[85] Fix | Delete
'hover' => 'tabs',
[86] Fix | Delete
),
[87] Fix | Delete
'alt' => array(
[88] Fix | Delete
'label' => esc_html__( 'Image Alternative Text', 'et_builder' ),
[89] Fix | Delete
'type' => 'text',
[90] Fix | Delete
'option_category' => 'basic_option',
[91] Fix | Delete
'depends_show_if' => 'on',
[92] Fix | Delete
'depends_on' => array(
[93] Fix | Delete
'src',
[94] Fix | Delete
),
[95] Fix | Delete
'description' => esc_html__( 'This defines the HTML ALT text. A short description of your image can be placed here.', 'et_builder' ),
[96] Fix | Delete
'tab_slug' => 'custom_css',
[97] Fix | Delete
'toggle_slug' => 'attributes',
[98] Fix | Delete
'dynamic_content' => 'text',
[99] Fix | Delete
),
[100] Fix | Delete
'title_text' => array(
[101] Fix | Delete
'label' => esc_html__( 'Image Title Text', 'et_builder' ),
[102] Fix | Delete
'type' => 'text',
[103] Fix | Delete
'option_category' => 'basic_option',
[104] Fix | Delete
'depends_show_if' => 'on',
[105] Fix | Delete
'depends_on' => array(
[106] Fix | Delete
'src',
[107] Fix | Delete
),
[108] Fix | Delete
'description' => esc_html__( 'This defines the HTML Title text.', 'et_builder' ),
[109] Fix | Delete
'tab_slug' => 'custom_css',
[110] Fix | Delete
'toggle_slug' => 'attributes',
[111] Fix | Delete
'dynamic_content' => 'text',
[112] Fix | Delete
),
[113] Fix | Delete
'show_in_lightbox' => array(
[114] Fix | Delete
'label' => esc_html__( 'Open In Lightbox', 'et_builder' ),
[115] Fix | Delete
'type' => 'yes_no_button',
[116] Fix | Delete
'option_category' => 'configuration',
[117] Fix | Delete
'options' => array(
[118] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[119] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[120] Fix | Delete
),
[121] Fix | Delete
'default_on_front' => 'off',
[122] Fix | Delete
'affects' => array(
[123] Fix | Delete
'url',
[124] Fix | Delete
'url_new_window',
[125] Fix | Delete
'use_overlay',
[126] Fix | Delete
),
[127] Fix | Delete
'toggle_slug' => 'link',
[128] Fix | Delete
'description' => esc_html__( 'Here you can choose whether or not the image should open in Lightbox. Note: if you select to open the image in Lightbox, url options below will be ignored.', 'et_builder' ),
[129] Fix | Delete
),
[130] Fix | Delete
'url' => array(
[131] Fix | Delete
'label' => esc_html__( 'Image Link URL', 'et_builder' ),
[132] Fix | Delete
'type' => 'text',
[133] Fix | Delete
'option_category' => 'basic_option',
[134] Fix | Delete
'depends_show_if' => 'off',
[135] Fix | Delete
'affects' => array(
[136] Fix | Delete
'use_overlay',
[137] Fix | Delete
),
[138] Fix | Delete
'description' => esc_html__( 'If you would like your image to be a link, input your destination URL here. No link will be created if this field is left blank.', 'et_builder' ),
[139] Fix | Delete
'toggle_slug' => 'link',
[140] Fix | Delete
'dynamic_content' => 'url',
[141] Fix | Delete
),
[142] Fix | Delete
'url_new_window' => array(
[143] Fix | Delete
'label' => esc_html__( 'Image Link Target', 'et_builder' ),
[144] Fix | Delete
'type' => 'select',
[145] Fix | Delete
'option_category' => 'configuration',
[146] Fix | Delete
'options' => array(
[147] Fix | Delete
'off' => esc_html__( 'In The Same Window', 'et_builder' ),
[148] Fix | Delete
'on' => esc_html__( 'In The New Tab', 'et_builder' ),
[149] Fix | Delete
),
[150] Fix | Delete
'default_on_front' => 'off',
[151] Fix | Delete
'depends_show_if' => 'off',
[152] Fix | Delete
'toggle_slug' => 'link',
[153] Fix | Delete
'description' => esc_html__( 'Here you can choose whether or not your link opens in a new window', 'et_builder' ),
[154] Fix | Delete
),
[155] Fix | Delete
'use_overlay' => array(
[156] Fix | Delete
'label' => esc_html__( 'Image Overlay', 'et_builder' ),
[157] Fix | Delete
'type' => 'yes_no_button',
[158] Fix | Delete
'option_category' => 'layout',
[159] Fix | Delete
'options' => array(
[160] Fix | Delete
'off' => et_builder_i18n( 'Off' ),
[161] Fix | Delete
'on' => et_builder_i18n( 'On' ),
[162] Fix | Delete
),
[163] Fix | Delete
'default_on_front' => 'off',
[164] Fix | Delete
'affects' => array(
[165] Fix | Delete
'overlay_icon_color',
[166] Fix | Delete
'hover_overlay_color',
[167] Fix | Delete
'hover_icon',
[168] Fix | Delete
),
[169] Fix | Delete
'depends_show_if' => 'on',
[170] Fix | Delete
'tab_slug' => 'advanced',
[171] Fix | Delete
'toggle_slug' => 'overlay',
[172] Fix | Delete
'description' => esc_html__( 'If enabled, an overlay color and icon will be displayed when a visitors hovers over the image', 'et_builder' ),
[173] Fix | Delete
),
[174] Fix | Delete
'overlay_icon_color' => array(
[175] Fix | Delete
'label' => esc_html__( 'Overlay Icon Color', 'et_builder' ),
[176] Fix | Delete
'type' => 'color-alpha',
[177] Fix | Delete
'custom_color' => true,
[178] Fix | Delete
'depends_show_if' => 'on',
[179] Fix | Delete
'tab_slug' => 'advanced',
[180] Fix | Delete
'toggle_slug' => 'overlay',
[181] Fix | Delete
'description' => esc_html__( 'Here you can define a custom color for the overlay icon', 'et_builder' ),
[182] Fix | Delete
),
[183] Fix | Delete
'hover_overlay_color' => array(
[184] Fix | Delete
'label' => esc_html__( 'Hover Overlay Color', 'et_builder' ),
[185] Fix | Delete
'type' => 'color-alpha',
[186] Fix | Delete
'custom_color' => true,
[187] Fix | Delete
'depends_show_if' => 'on',
[188] Fix | Delete
'tab_slug' => 'advanced',
[189] Fix | Delete
'toggle_slug' => 'overlay',
[190] Fix | Delete
'description' => esc_html__( 'Here you can define a custom color for the overlay', 'et_builder' ),
[191] Fix | Delete
),
[192] Fix | Delete
'hover_icon' => array(
[193] Fix | Delete
'label' => esc_html__( 'Hover Icon Picker', 'et_builder' ),
[194] Fix | Delete
'type' => 'select_icon',
[195] Fix | Delete
'option_category' => 'configuration',
[196] Fix | Delete
'class' => array( 'et-pb-font-icon' ),
[197] Fix | Delete
'depends_show_if' => 'on',
[198] Fix | Delete
'tab_slug' => 'advanced',
[199] Fix | Delete
'toggle_slug' => 'overlay',
[200] Fix | Delete
'description' => esc_html__( 'Here you can define a custom icon for the overlay', 'et_builder' ),
[201] Fix | Delete
),
[202] Fix | Delete
);
[203] Fix | Delete
[204] Fix | Delete
return $fields;
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
public function get_transition_fields_css_props() {
[208] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[209] Fix | Delete
$filters = $this->get_transition_filters_fields_css_props( 'child_filters' );
[210] Fix | Delete
[211] Fix | Delete
return array_merge( $fields, $filters );
[212] Fix | Delete
}
[213] Fix | Delete
[214] Fix | Delete
function render( $attrs, $content = null, $render_slug ) {
[215] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[216] Fix | Delete
$src = $this->props['src'];
[217] Fix | Delete
$alt = $this->props['alt'];
[218] Fix | Delete
$title_text = $this->props['title_text'];
[219] Fix | Delete
$url = $this->props['url'];
[220] Fix | Delete
$url_new_window = $this->props['url_new_window'];
[221] Fix | Delete
$show_in_lightbox = $this->props['show_in_lightbox'];
[222] Fix | Delete
$overlay_icon_color = $this->props['overlay_icon_color'];
[223] Fix | Delete
$hover_overlay_color = $this->props['hover_overlay_color'];
[224] Fix | Delete
$hover_icon = $this->props['hover_icon'];
[225] Fix | Delete
$use_overlay = $this->props['use_overlay'];
[226] Fix | Delete
$animation_style = $this->props['animation_style'];
[227] Fix | Delete
[228] Fix | Delete
$video_background = $this->video_background();
[229] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[230] Fix | Delete
[231] Fix | Delete
// Load up Dynamic Content (if needed) to capture Featured Image objects.
[232] Fix | Delete
// In this way we can process `alt` and `title` attributes defined in
[233] Fix | Delete
// the WP Media Library when they haven't been specified by the user in
[234] Fix | Delete
// Module Settings.
[235] Fix | Delete
if ( empty($alt) || empty($title_text) ) {
[236] Fix | Delete
$raw_src = et_()->array_get( $this->attrs_unprocessed, 'src' );
[237] Fix | Delete
$src_value = et_builder_parse_dynamic_content( $raw_src );
[238] Fix | Delete
[239] Fix | Delete
if ( $src_value->is_dynamic() && $src_value->get_content() === 'post_featured_image' ) {
[240] Fix | Delete
// If there is no user-specified ALT attribute text, check the WP
[241] Fix | Delete
// Media Library entry for text that may have been added there.
[242] Fix | Delete
if ( empty($alt) ) {
[243] Fix | Delete
$alt = et_builder_resolve_dynamic_content( 'post_featured_image_alt_text', array(), get_the_ID(), 'display' );
[244] Fix | Delete
}
[245] Fix | Delete
[246] Fix | Delete
// If there is no user-specified TITLE attribute text, check the WP
[247] Fix | Delete
// Media Library entry for text that may have been added there.
[248] Fix | Delete
if ( empty($title_text) ) {
[249] Fix | Delete
$title_text = et_builder_resolve_dynamic_content( 'post_featured_image_title_text', array(), get_the_ID(), 'display' );
[250] Fix | Delete
}
[251] Fix | Delete
}
[252] Fix | Delete
}
[253] Fix | Delete
[254] Fix | Delete
// overlay can be applied only if image has link or if lightbox enabled
[255] Fix | Delete
$is_overlay_applied = 'on' === $use_overlay && ( 'on' === $show_in_lightbox || ( 'off' === $show_in_lightbox && '' !== $url ) ) ? 'on' : 'off';
[256] Fix | Delete
[257] Fix | Delete
if ( 'on' === $is_overlay_applied ) {
[258] Fix | Delete
if ( '' !== $overlay_icon_color ) {
[259] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[260] Fix | Delete
'selector' => '%%order_class%% .et_overlay:before',
[261] Fix | Delete
'declaration' => sprintf(
[262] Fix | Delete
'color: %1$s !important;',
[263] Fix | Delete
esc_html( $overlay_icon_color )
[264] Fix | Delete
),
[265] Fix | Delete
) );
[266] Fix | Delete
}
[267] Fix | Delete
[268] Fix | Delete
if ( '' !== $hover_overlay_color ) {
[269] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[270] Fix | Delete
'selector' => '%%order_class%% .et_overlay',
[271] Fix | Delete
'declaration' => sprintf(
[272] Fix | Delete
'background-color: %1$s;',
[273] Fix | Delete
esc_html( $hover_overlay_color )
[274] Fix | Delete
),
[275] Fix | Delete
) );
[276] Fix | Delete
}
[277] Fix | Delete
[278] Fix | Delete
$data_icon = '' !== $hover_icon
[279] Fix | Delete
? sprintf(
[280] Fix | Delete
' data-icon="%1$s"',
[281] Fix | Delete
esc_attr( et_pb_process_font_icon( $hover_icon ) )
[282] Fix | Delete
)
[283] Fix | Delete
: '';
[284] Fix | Delete
[285] Fix | Delete
$overlay_output = sprintf(
[286] Fix | Delete
'<span class="et_overlay%1$s"%2$s></span>',
[287] Fix | Delete
( '' !== $hover_icon ? ' et_pb_inline_icon' : '' ),
[288] Fix | Delete
$data_icon
[289] Fix | Delete
);
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
$image_html = $multi_view->render_element( array(
[293] Fix | Delete
'tag' => 'img',
[294] Fix | Delete
'attrs' => array(
[295] Fix | Delete
'src' => '{{src}}',
[296] Fix | Delete
'alt' => $alt,
[297] Fix | Delete
'title' => $title_text,
[298] Fix | Delete
),
[299] Fix | Delete
'required' => 'src',
[300] Fix | Delete
) );
[301] Fix | Delete
[302] Fix | Delete
$output = sprintf(
[303] Fix | Delete
'%1$s
[304] Fix | Delete
%2$s',
[305] Fix | Delete
$image_html,
[306] Fix | Delete
'on' === $is_overlay_applied ? $overlay_output : ''
[307] Fix | Delete
);
[308] Fix | Delete
[309] Fix | Delete
if ( 'on' === $show_in_lightbox ) {
[310] Fix | Delete
$output = sprintf( '<a href="%1$s" class="et_pb_lightbox_image" title="%3$s">%2$s</a>',
[311] Fix | Delete
esc_attr( $src ),
[312] Fix | Delete
$output,
[313] Fix | Delete
esc_attr( $title_text )
[314] Fix | Delete
);
[315] Fix | Delete
} else if ( '' !== $url ) {
[316] Fix | Delete
$output = sprintf( '<a href="%1$s"%3$s>%2$s</a>',
[317] Fix | Delete
esc_url( $url ),
[318] Fix | Delete
$output,
[319] Fix | Delete
( 'on' === $url_new_window ? ' target="_blank"' : '' )
[320] Fix | Delete
);
[321] Fix | Delete
}
[322] Fix | Delete
[323] Fix | Delete
// Module classnames
[324] Fix | Delete
if ( ! in_array( $animation_style, array( '', 'none' ) ) ) {
[325] Fix | Delete
$this->add_classname( 'et-waypoint' );
[326] Fix | Delete
}
[327] Fix | Delete
[328] Fix | Delete
if ( 'on' === $is_overlay_applied ) {
[329] Fix | Delete
$this->add_classname( 'et_pb_has_overlay' );
[330] Fix | Delete
}
[331] Fix | Delete
[332] Fix | Delete
$output = sprintf(
[333] Fix | Delete
'<div%3$s class="%2$s">
[334] Fix | Delete
%5$s
[335] Fix | Delete
%4$s
[336] Fix | Delete
%1$s
[337] Fix | Delete
</div>',
[338] Fix | Delete
$output,
[339] Fix | Delete
$this->module_classname( $render_slug ),
[340] Fix | Delete
$this->module_id(),
[341] Fix | Delete
$video_background,
[342] Fix | Delete
$parallax_image_background
[343] Fix | Delete
);
[344] Fix | Delete
[345] Fix | Delete
return $output;
[346] Fix | Delete
}
[347] Fix | Delete
}
[348] Fix | Delete
[349] Fix | Delete
new ET_Builder_Module_Fullwidth_Image;
[350] Fix | Delete
[351] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function