: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'toggle_slug' => 'featured_image',
'description' => esc_html__( 'This setting will turn on and off the featured image in the slider.', 'et_builder' ),
'mobile_options' => true,
'image_placement' => array(
'label' => esc_html__( 'Featured Image Placement', 'et_builder' ),
'option_category' => 'configuration',
'background' => et_builder_i18n( 'Background' ),
'left' => et_builder_i18n( 'Left' ),
'right' => et_builder_i18n( 'Right' ),
'top' => et_builder_i18n( 'Top' ),
'bottom' => et_builder_i18n( 'Bottom' ),
'default_on_front' => 'background',
'depends_show_if' => 'on',
'toggle_slug' => 'featured_image',
'description' => esc_html__( 'Select how you would like to display the featured image in slides', 'et_builder' ),
'use_bg_overlay' => array(
'label' => esc_html__( 'Use Background Overlay', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'on' => et_builder_i18n( 'Yes' ),
'off' => et_builder_i18n( 'No' ),
'default_on_front' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'When enabled, a custom overlay color will be added above your background image and behind your slider content.', 'et_builder' ),
'bg_overlay_color' => array(
'label' => esc_html__( 'Background Overlay Color', 'et_builder' ),
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'Use the color picker to choose a color for the background overlay.', 'et_builder' ),
'mobile_options' => true,
'use_text_overlay' => array(
'label' => esc_html__( 'Use Text Overlay', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'off' => et_builder_i18n( 'No' ),
// Uses cached uppercase translation but keeps the lowercase not change definition content.
'on' => strtolower( et_builder_i18n( 'Yes' ) ),
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'When enabled, a background color is added behind the slider text to make it more readable atop background images.', 'et_builder' ),
'text_overlay_color' => array(
'label' => esc_html__( 'Text Overlay Color', 'et_builder' ),
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'Use the color picker to choose a color for the text overlay.', 'et_builder' ),
'mobile_options' => true,
'show_content_on_mobile' => array(
'label' => esc_html__( 'Show Content On Mobile', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'layout',
'on' => et_builder_i18n( 'Yes' ),
'off' => et_builder_i18n( 'No' ),
'default_on_front' => 'on',
'tab_slug' => 'custom_css',
'toggle_slug' => 'visibility',
'show_cta_on_mobile' => array(
'label' => esc_html__( 'Show CTA On Mobile', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'layout',
'on' => et_builder_i18n( 'Yes' ),
'off' => et_builder_i18n( 'No' ),
'default_on_front' => 'on',
'tab_slug' => 'custom_css',
'toggle_slug' => 'visibility',
'show_image_video_mobile' => array(
'label' => esc_html__( 'Show Image On Mobile', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'layout',
'off' => et_builder_i18n( 'No' ),
'on' => et_builder_i18n( 'Yes' ),
'default_on_front' => 'off',
'tab_slug' => 'custom_css',
'toggle_slug' => 'visibility',
'text_border_radius' => array(
'label' => esc_html__( 'Text Overlay Border Radius', 'et_builder' ),
'description' => esc_html__( 'Increasing the border radius will increase the roundness of the overlay corners. Setting this value to 0 will result in squared corners.', 'et_builder' ),
'option_category' => 'layout',
'allowed_units' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
'default_on_front' => '',
'range_settings' => array(
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'mobile_options' => true,
'arrows_custom_color' => array(
'label' => esc_html__( 'Arrow Color', 'et_builder' ),
'description' => esc_html__( 'Pick a color to use for the slider arrows that are used to navigate through each slide.', 'et_builder' ),
'tab_slug' => 'advanced',
'toggle_slug' => 'navigation',
'mobile_options' => true,
'dot_nav_custom_color' => array(
'label' => esc_html__( 'Dot Navigation Color', 'et_builder' ),
'description' => esc_html__( 'Pick a color to use for the dot navigation that appears at the bottom of the slider to designate which slide is active.', 'et_builder' ),
'tab_slug' => 'advanced',
'toggle_slug' => 'navigation',
'mobile_options' => true,
'computed_callback' => array( 'ET_Builder_Module_Post_Slider', 'get_blog_posts' ),
'computed_depends_on' => array(
'offset_number' => array(
'label' => esc_html__( 'Offset Number', 'et_builder' ),
'description' => esc_html__( 'Choose how many posts you would like to offset by', 'et_builder' ),
'option_category' => 'configuration',
'toggle_slug' => 'main_content',
'computed_affects' => array(
public function get_transition_fields_css_props() {
$fields = parent::get_transition_fields_css_props();
$fields['background_layout'] = array(
'background-color' => '%%order_class%% .et_pb_slide_overlay_container, %%order_class%% .et_pb_text_overlay_wrapper',
'color' => self::$_->array_get( $this->advanced_fields, 'text.css.main', '%%order_class%%' ),
$fields['bg_overlay_color'] = array(
'background-color' => '%%order_class%% .et_pb_slide .et_pb_slide_overlay_container',
$fields['text_overlay_color'] = array(
'background-color' => '%%order_class%% .et_pb_slide .et_pb_text_overlay_wrapper',
$fields['dot_nav_custom_color'] = array( 'background-color' => et_pb_slider_options()->get_dots_selector() );
$fields['arrows_custom_color'] = array( 'all' => et_pb_slider_options()->get_arrows_selector() );
static function get_blog_posts( $args = array(), $conditional_tags = array(), $current_page = array(), $is_ajax_request = true ) {
global $wp_query, $paged, $post;
'use_current_loop' => 'off',
'include_categories' => '',
'use_manual_excerpt' => '',
$args = wp_parse_args( $args, $defaults );
// Include query args that we don't control.
$query_args = array_merge( array_diff_key( $args, $defaults ), array(
'posts_per_page' => (int) $args['posts_number'],
'post_status' => array( 'publish', 'private' ),
if ( 'on' === $args['use_current_loop'] ) {
// Reset loop-affecting values to their defaults to simulate the current loop.
$reset_keys = array( 'include_categories', 'orderby' );
foreach ( $reset_keys as $key ) {
$args[ $key ] = $defaults[ $key ];
if ( '' !== $args['include_categories'] ) {
$query_args['cat'] = $args['include_categories'];
if ( 'date_desc' !== $args['orderby'] ) {
switch ( $args['orderby'] ) {
$query_args['orderby'] = 'date';
$query_args['order'] = 'ASC';
$query_args['orderby'] = 'title';
$query_args['order'] = 'ASC';
$query_args['orderby'] = 'title';
$query_args['order'] = 'DESC';
$query_args['orderby'] = 'rand';
if ( '' !== $args['offset_number'] && ! empty( $args['offset_number'] ) ) {
* Offset + pagination don't play well. Manual offset calculation required
* @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
$query_args['offset'] = ( ( $paged - 1 ) * intval( $args['posts_number'] ) ) + intval( $args['offset_number'] );
$query_args['offset'] = intval( $args['offset_number'] );
$query = new WP_Query( $query_args );
// Keep page's $wp_query global
$wp_query_page = $wp_query;
// Turn page's $wp_query into this module's query
$wp_query = $query; //phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
ET_Post_Stack::replace( $post );
$post_author_id = $query->posts[ $post_index ]->post_author;
$categories_object = get_the_terms( get_the_ID(), 'category' );
if ( ! empty( $categories_object ) ) {
foreach ( $categories_object as $category ) {
'id' => $category->term_id,
'label' => $category->name,
'permalink' => get_term_link( $category ),
$has_post_thumbnail = has_post_thumbnail();
$query->posts[ $post_index ]->has_post_thumbnail = $has_post_thumbnail;
$query->posts[ $post_index ]->post_thumbnail = $has_post_thumbnail ? get_the_post_thumbnail() : '';
$query->posts[ $post_index ]->post_featured_image = $has_post_thumbnail ? esc_url( wp_get_attachment_url( get_post_thumbnail_id() ) ) : '';
$query->posts[ $post_index ]->post_permalink = get_the_permalink();
$query->posts[ $post_index ]->post_author_url = get_author_posts_url( $post_author_id );
$query->posts[ $post_index ]->post_author_name = get_the_author_meta( 'display_name', $post_author_id );
$query->posts[ $post_index ]->post_date_readable = get_the_date();
$query->posts[ $post_index ]->categories = $categories;
$query->posts[ $post_index ]->post_comment_popup = et_core_maybe_convert_to_utf_8( sprintf( esc_html( _nx( '%s Comment', '%s Comments', get_comments_number(), 'number of comments', 'et_builder' ) ), number_format_i18n( get_comments_number() ) ) );
$post_content = et_strip_shortcodes( get_the_content(), true );
global $et_fb_processing_shortcode_object, $et_pb_rendering_column_content;
$global_processing_original_value = $et_fb_processing_shortcode_object;
// reset the fb processing flag
$et_fb_processing_shortcode_object = false;
// set the flag to indicate that we're processing internal content
$et_pb_rendering_column_content = true;
if ( $is_ajax_request ) {
// reset all the attributes required to properly generate the internal styles
ET_Builder_Element::clean_internal_modules_styles();
if ( 'both' === $args['content_source'] ) {
// page builder doesn't support more tag, so display the_content() in case of post made with page builder.
if ( et_pb_is_pagebuilder_used( get_the_ID() ) || has_block( 'divi/layout', get_the_ID() ) ) {
$more = 1; // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
// do_shortcode for Divi Plugin instead of applying `the_content` filter to avoid conflicts with 3rd party themes.
$builder_post_content = et_is_builder_plugin_active() ? do_shortcode( $post_content ) : apply_filters( 'the_content', $post_content );
// Overwrite default content, in case the content is protected.
$query->posts[ $post_index ]->post_content = $builder_post_content;
$more = null; // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
// Overwrite default content, in case the content is protected.
$query->posts[ $post_index ]->post_content = et_is_builder_plugin_active() ? do_shortcode( get_the_content( '' ) ) : apply_filters( 'the_content', get_the_content( '' ) );
if ( has_excerpt() && 'off' !== $args['use_manual_excerpt'] ) {
$query->posts[ $post_index ]->post_excerpt = et_is_builder_plugin_active() ? do_shortcode( et_strip_shortcodes( get_the_excerpt(), true ) ) : apply_filters( 'the_content', et_strip_shortcodes( get_the_excerpt(), true ) );
$query->posts[ $post_index ]->post_excerpt = strip_shortcodes( truncate_post( intval( $args['excerpt_length'] ), false, '', true ) );
} else if ( 'on' === $args['content_source'] ) {
if ( et_pb_is_pagebuilder_used( get_the_ID() ) || has_block( 'divi/layout', get_the_ID() ) ) {
$more = 1; // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
// do_shortcode for Divi Plugin instead of applying `the_content` filter to avoid conflicts with 3rd party themes.
$builder_post_content = et_is_builder_plugin_active() ? do_shortcode( $post_content ) : apply_filters( 'the_content', $post_content );
// Overwrite default content, in case the content is protected.
$query->posts[ $post_index ]->post_content = $builder_post_content;
$more = null; // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
// Overwrite default content, in case the content is protected.
$query->posts[ $post_index ]->post_content = et_is_builder_plugin_active() ? do_shortcode( get_the_content( '' ) ) : apply_filters( 'the_content', get_the_content( '' ) );
if ( has_excerpt() && 'off' !== $args['use_manual_excerpt'] ) {
$query->posts[ $post_index ]->post_content = et_is_builder_plugin_active() ? do_shortcode( et_strip_shortcodes( get_the_excerpt(), true ) ) : apply_filters( 'the_content', et_strip_shortcodes( get_the_excerpt(), true ) );
$query->posts[ $post_index ]->post_content = strip_shortcodes( truncate_post( intval( $args['excerpt_length'] ), false, '', true ) );
$et_fb_processing_shortcode_object = $global_processing_original_value;
if ( $is_ajax_request ) {
// retrieve the styles for the modules inside Blog content
$internal_style = ET_Builder_Element::get_style( true );
// reset all the attributes after we retrieved styles
ET_Builder_Element::clean_internal_modules_styles( false );
$query->posts[ $post_index ]->internal_styles = $internal_style;
$et_pb_rendering_column_content = false;
} else if ( self::is_processing_computed_prop() ) {
$query = '<div class="et_pb_no_results">';
$query .= self::get_no_results_template();
$query = array( 'posts' => $query );
// Reset $wp_query to its origin
$wp_query = $wp_query_page; // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
function render( $attrs, $content = null, $render_slug ) {
$multi_view = et_pb_multi_view_options( $this );
$use_current_loop = isset( $this->props['use_current_loop'] ) ? $this->props['use_current_loop'] : 'off';
$show_arrows = $this->props['show_arrows'];
$show_pagination = $this->props['show_pagination'];
$parallax = $this->props['parallax'];
$parallax_method = $this->props['parallax_method'];
$auto = $this->props['auto'];
$auto_speed = $this->props['auto_speed'];
$auto_ignore_hover = $this->props['auto_ignore_hover'];
$body_font_size = $this->props['body_font_size'];
$show_content_on_mobile = $this->props['show_content_on_mobile'];
$show_cta_on_mobile = $this->props['show_cta_on_mobile'];
$show_image_video_mobile = $this->props['show_image_video_mobile'];
$background_position = $this->props['background_position'];
$background_size = $this->props['background_size'];
$background_repeat = $this->props['background_repeat'];
$background_blend = $this->props['background_blend'];
$posts_number = $this->props['posts_number'];
$include_categories = $this->props['include_categories'];
$show_more_button = $this->props['show_more_button'];
$more_text = $this->props['more_text'];
$content_source = $this->props['content_source'];
$background_color = $this->props['background_color'];
$show_image = $this->props['show_image'];
$image_placement = $this->props['image_placement'];
$background_image = $this->props['background_image'];
$use_bg_overlay = $this->props['use_bg_overlay'];
$use_text_overlay = $this->props['use_text_overlay'];
$orderby = $this->props['orderby'];
$show_meta = $this->props['show_meta'];
$button_custom = $this->props['custom_button'];
$use_manual_excerpt = $this->props['use_manual_excerpt'];
$excerpt_length = $this->props['excerpt_length'];
$button_rel = $this->props['button_rel'];
$header_level = $this->props['header_level'];
$offset_number = $this->props['offset_number'];
$bg_overlay_color_hover = $this->get_hover_value( 'bg_overlay_color' );
$bg_overlay_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'bg_overlay_color' );
$text_overlay_color_hover = $this->get_hover_value( 'text_overlay_color' );
$text_overlay_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'text_overlay_color' );
$text_border_radius_values = et_pb_responsive_options()->get_property_values( $this->props, 'text_border_radius' );
$hide_on_mobile_class = self::HIDE_ON_MOBILE;
$is_text_overlay_applied = 'on' === $use_text_overlay;
$custom_icon_values = et_pb_responsive_options()->get_property_values( $this->props, 'button_icon' );
$custom_icon = isset( $custom_icon_values['desktop'] ) ? $custom_icon_values['desktop'] : '';
$custom_icon_tablet = isset( $custom_icon_values['tablet'] ) ? $custom_icon_values['tablet'] : '';
$custom_icon_phone = isset( $custom_icon_values['phone'] ) ? $custom_icon_values['phone'] : '';
if ( 'on' === $use_bg_overlay ) {
// Background Overlay color.
et_pb_responsive_options()->generate_responsive_css( $bg_overlay_color_values, '%%order_class%% .et_pb_slide .et_pb_slide_overlay_container', 'background-color', $render_slug, '', 'color' );
if ( '' !== $bg_overlay_color_hover ) {
ET_Builder_Element::set_style( $render_slug, array(
'selector' => $this->add_hover_to_order_class( '%%order_class%% .et_pb_slide .et_pb_slide_overlay_container' ),
'declaration' => sprintf(
'background-color: %1$s;',
esc_html( $bg_overlay_color_hover )
if ( $is_text_overlay_applied ) {
et_pb_responsive_options()->generate_responsive_css( $text_overlay_color_values, '%%order_class%% .et_pb_slide .et_pb_text_overlay_wrapper', 'background-color', $render_slug, '', 'color' );
if ( '' !== $text_overlay_color_hover ) {
ET_Builder_Element::set_style( $render_slug, array(
'selector' => $this->add_hover_to_order_class( '%%order_class%% .et_pb_slide .et_pb_text_overlay_wrapper' ),
'declaration' => sprintf(
'background-color: %1$s;',
esc_html( $text_overlay_color_hover )
// Text Overlay Border Radius.
et_pb_responsive_options()->generate_responsive_css( $text_border_radius_values, '%%order_class%%.et_pb_slider_with_text_overlay .et_pb_text_overlay_wrapper', 'border-radius', $render_slug );
$this->generate_responsive_hover_style( 'arrows_custom_color', et_pb_slider_options()->get_arrows_selector(), 'color' );
$this->generate_responsive_hover_style( 'dot_nav_custom_color', et_pb_slider_options()->get_dots_selector(), 'background-color' );