: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
class ET_Builder_Module_Fullwidth_Image extends ET_Builder_Module {
$this->name = esc_html__( 'Fullwidth Image', 'et_builder' );
$this->plural = esc_html__( 'Fullwidth Images', 'et_builder' );
$this->slug = 'et_pb_fullwidth_image';
$this->vb_support = 'on';
$this->settings_modal_toggles = array(
'main_content' => et_builder_i18n( 'Image' ),
'link' => et_builder_i18n( 'Link' ),
'overlay' => et_builder_i18n( 'Overlay' ),
'title' => esc_html__( 'Animation', 'et_builder' ),
'title' => esc_html__( 'Attributes', 'et_builder' ),
$this->advanced_fields = array(
'margin_padding' => array(
'position_fields' => array(
$this->help_videos = array(
'name' => esc_html__( 'An introduction to the Fullwidth Image module', 'et_builder' ),
'label' => et_builder_i18n( 'Image' ),
'option_category' => 'basic_option',
'upload_button_text' => et_builder_i18n( 'Upload an image' ),
'choose_text' => esc_attr__( 'Choose an Image', 'et_builder' ),
'update_text' => esc_attr__( 'Set As Image', 'et_builder' ),
'description' => esc_html__( 'Upload your desired image, or type in the URL to the image you would like to display.', 'et_builder' ),
'toggle_slug' => 'main_content',
'dynamic_content' => 'image',
'mobile_options' => true,
'label' => esc_html__( 'Image Alternative Text', 'et_builder' ),
'option_category' => 'basic_option',
'depends_show_if' => 'on',
'description' => esc_html__( 'This defines the HTML ALT text. A short description of your image can be placed here.', 'et_builder' ),
'tab_slug' => 'custom_css',
'toggle_slug' => 'attributes',
'dynamic_content' => 'text',
'label' => esc_html__( 'Image Title Text', 'et_builder' ),
'option_category' => 'basic_option',
'depends_show_if' => 'on',
'description' => esc_html__( 'This defines the HTML Title text.', 'et_builder' ),
'tab_slug' => 'custom_css',
'toggle_slug' => 'attributes',
'dynamic_content' => 'text',
'show_in_lightbox' => array(
'label' => esc_html__( 'Open In Lightbox', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'off' => et_builder_i18n( 'No' ),
'on' => et_builder_i18n( 'Yes' ),
'default_on_front' => 'off',
'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' ),
'label' => esc_html__( 'Image Link URL', 'et_builder' ),
'option_category' => 'basic_option',
'depends_show_if' => 'off',
'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' ),
'dynamic_content' => 'url',
'url_new_window' => array(
'label' => esc_html__( 'Image Link Target', 'et_builder' ),
'option_category' => 'configuration',
'off' => esc_html__( 'In The Same Window', 'et_builder' ),
'on' => esc_html__( 'In The New Tab', 'et_builder' ),
'default_on_front' => 'off',
'depends_show_if' => 'off',
'description' => esc_html__( 'Here you can choose whether or not your link opens in a new window', 'et_builder' ),
'label' => esc_html__( 'Image Overlay', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'layout',
'off' => et_builder_i18n( 'Off' ),
'on' => et_builder_i18n( 'On' ),
'default_on_front' => 'off',
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'If enabled, an overlay color and icon will be displayed when a visitors hovers over the image', 'et_builder' ),
'overlay_icon_color' => array(
'label' => esc_html__( 'Overlay Icon Color', 'et_builder' ),
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'Here you can define a custom color for the overlay icon', 'et_builder' ),
'hover_overlay_color' => array(
'label' => esc_html__( 'Hover Overlay Color', 'et_builder' ),
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'Here you can define a custom color for the overlay', 'et_builder' ),
'label' => esc_html__( 'Hover Icon Picker', 'et_builder' ),
'option_category' => 'configuration',
'class' => array( 'et-pb-font-icon' ),
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'Here you can define a custom icon for the overlay', 'et_builder' ),
public function get_transition_fields_css_props() {
$fields = parent::get_transition_fields_css_props();
$filters = $this->get_transition_filters_fields_css_props( 'child_filters' );
return array_merge( $fields, $filters );
function render( $attrs, $content = null, $render_slug ) {
$multi_view = et_pb_multi_view_options( $this );
$src = $this->props['src'];
$alt = $this->props['alt'];
$title_text = $this->props['title_text'];
$url = $this->props['url'];
$url_new_window = $this->props['url_new_window'];
$show_in_lightbox = $this->props['show_in_lightbox'];
$overlay_icon_color = $this->props['overlay_icon_color'];
$hover_overlay_color = $this->props['hover_overlay_color'];
$hover_icon = $this->props['hover_icon'];
$use_overlay = $this->props['use_overlay'];
$animation_style = $this->props['animation_style'];
$video_background = $this->video_background();
$parallax_image_background = $this->get_parallax_image_background();
// Load up Dynamic Content (if needed) to capture Featured Image objects.
// In this way we can process `alt` and `title` attributes defined in
// the WP Media Library when they haven't been specified by the user in
if ( empty($alt) || empty($title_text) ) {
$raw_src = et_()->array_get( $this->attrs_unprocessed, 'src' );
$src_value = et_builder_parse_dynamic_content( $raw_src );
if ( $src_value->is_dynamic() && $src_value->get_content() === 'post_featured_image' ) {
// If there is no user-specified ALT attribute text, check the WP
// Media Library entry for text that may have been added there.
$alt = et_builder_resolve_dynamic_content( 'post_featured_image_alt_text', array(), get_the_ID(), 'display' );
// If there is no user-specified TITLE attribute text, check the WP
// Media Library entry for text that may have been added there.
if ( empty($title_text) ) {
$title_text = et_builder_resolve_dynamic_content( 'post_featured_image_title_text', array(), get_the_ID(), 'display' );
// overlay can be applied only if image has link or if lightbox enabled
$is_overlay_applied = 'on' === $use_overlay && ( 'on' === $show_in_lightbox || ( 'off' === $show_in_lightbox && '' !== $url ) ) ? 'on' : 'off';
if ( 'on' === $is_overlay_applied ) {
if ( '' !== $overlay_icon_color ) {
ET_Builder_Element::set_style( $render_slug, array(
'selector' => '%%order_class%% .et_overlay:before',
'declaration' => sprintf(
'color: %1$s !important;',
esc_html( $overlay_icon_color )
if ( '' !== $hover_overlay_color ) {
ET_Builder_Element::set_style( $render_slug, array(
'selector' => '%%order_class%% .et_overlay',
'declaration' => sprintf(
'background-color: %1$s;',
esc_html( $hover_overlay_color )
$data_icon = '' !== $hover_icon
esc_attr( et_pb_process_font_icon( $hover_icon ) )
$overlay_output = sprintf(
'<span class="et_overlay%1$s"%2$s></span>',
( '' !== $hover_icon ? ' et_pb_inline_icon' : '' ),
$image_html = $multi_view->render_element( array(
'on' === $is_overlay_applied ? $overlay_output : ''
if ( 'on' === $show_in_lightbox ) {
$output = sprintf( '<a href="%1$s" class="et_pb_lightbox_image" title="%3$s">%2$s</a>',
} else if ( '' !== $url ) {
$output = sprintf( '<a href="%1$s"%3$s>%2$s</a>',
( 'on' === $url_new_window ? ' target="_blank"' : '' )
if ( ! in_array( $animation_style, array( '', 'none' ) ) ) {
$this->add_classname( 'et-waypoint' );
if ( 'on' === $is_overlay_applied ) {
$this->add_classname( 'et_pb_has_overlay' );
$this->module_classname( $render_slug ),
$parallax_image_background
new ET_Builder_Module_Fullwidth_Image;