: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
require_once 'helpers/Slider.php';
class ET_Builder_Module_Fullwidth_Post_Slider extends ET_Builder_Module_Type_PostBased {
$this->name = esc_html__( 'Fullwidth Post Slider', 'et_builder' );
$this->plural = esc_html__( 'Fullwidth Post Sliders', 'et_builder' );
$this->slug = 'et_pb_fullwidth_post_slider';
$this->vb_support = 'on';
// Save processed background so it can be modified & reapplied on another element
$this->save_processed_background = true;
// need to use global settings from the fullwidth slider module
$this->global_settings_slug = 'et_pb_fullwidth_slider';
$this->main_css_element = '%%order_class%%.et_pb_slider';
$this->settings_modal_toggles = array(
'main_content' => et_builder_i18n( 'Content' ),
'elements' => et_builder_i18n( 'Elements' ),
'featured_image' => esc_html__( 'Featured Image', 'et_builder' ),
'layout' => et_builder_i18n( 'Layout' ),
'overlay' => et_builder_i18n( 'Overlay' ),
'navigation' => esc_html__( 'Navigation', 'et_builder' ),
'image' => et_builder_i18n( 'Image' ),
'title' => et_builder_i18n( 'Text' ),
'title' => esc_html__( 'Animation', 'et_builder' ),
$this->advanced_fields = array(
'label' => et_builder_i18n( 'Title' ),
'main' => "{$this->main_css_element} .et_pb_slide_description .et_pb_slide_title, {$this->main_css_element} .et_pb_slide_description .et_pb_slide_title a",
'important' => array( 'size', 'font-size' ),
'label' => et_builder_i18n( 'Body' ),
'line_height' => "{$this->main_css_element}",
'main' => "{$this->main_css_element} .et_pb_slide_content, {$this->main_css_element} .et_pb_slide_content div",
'block_elements' => array(
'tabbed_subtoggles' => true,
'bb_icons_support' => true,
'link' => "{$this->main_css_element} .et_pb_slide_content a",
'ul' => "{$this->main_css_element} .et_pb_slide_content ul li",
'ul_item_indent' => "{$this->main_css_element} .et_pb_slide_content ul",
'ol' => "{$this->main_css_element} .et_pb_slide_content ol li",
'ol_item_indent' => "{$this->main_css_element} .et_pb_slide_content ol",
'quote' => "{$this->main_css_element} .et_pb_slide_content blockquote",
'label' => esc_html__( 'Meta', 'et_builder' ),
'main' => "{$this->main_css_element} .et_pb_slide_content .post-meta, {$this->main_css_element} .et_pb_slide_content .post-meta a",
'limited_main' => "{$this->main_css_element} .et_pb_slide_content .post-meta, {$this->main_css_element} .et_pb_slide_content .post-meta a, {$this->main_css_element} .et_pb_slide_content .post-meta span",
'letter_spacing' => array(
'label' => et_builder_i18n( 'Button' ),
'main' => "{$this->main_css_element} .et_pb_more_button.et_pb_button",
'limited_main' => "{$this->main_css_element} .et_pb_more_button.et_pb_button",
'alignment' => "{$this->main_css_element} .et_pb_button_wrapper",
'main' => '%%order_class%% .et_pb_button',
'margin_padding' => array(
'label' => esc_html__( 'Image Box Shadow', 'et_builder' ),
'option_category' => 'layout',
'tab_slug' => 'advanced',
'toggle_slug' => 'image',
'main' => '%%order_class%% .et_pb_slide_image img',
'default_on_fronts' => array(
'main' => '%%order_class%%, %%order_class%%.et_pb_bg_layout_dark, %%order_class%%.et_pb_bg_layout_light',
'background_color' => array(
'default' => et_builder_accent_color(),
'background_position' => array(
'parallax_method' => array(
'margin_padding' => array(
'main' => '%%order_class%%',
'padding' => '%%order_class%% .et_pb_slide_description, .et_pb_slider_fullwidth_off%%order_class%% .et_pb_slide_description',
'important' => array( 'custom_margin' ), // needed to overwrite last module margin-bottom styling
'use_background_layout' => true,
'main' => implode( ', ', array(
'%%order_class%% .et_pb_slide .et_pb_slide_description .et_pb_slide_title',
'%%order_class%% .et_pb_slide .et_pb_slide_description .et_pb_slide_title a',
'%%order_class%% .et_pb_slide .et_pb_slide_description .et_pb_slide_content',
'%%order_class%% .et_pb_slide .et_pb_slide_description .et_pb_slide_content .post-meta',
'%%order_class%% .et_pb_slide .et_pb_slide_description .et_pb_slide_content .post-meta a',
'%%order_class%% .et_pb_slide .et_pb_slide_description .et_pb_slide_content .et_pb_button',
'text_orientation' => '%%order_class%% .et_pb_slide .et_pb_slide_description',
'text_shadow' => '%%order_class%% .et_pb_slide .et_pb_slide_description',
'text_orientation' => array(
'background_layout' => array(
'border_radii' => "%%order_class%%, %%order_class%% .et_pb_slide, %%order_class%% .et_pb_slide_overlay_container",
'border_radii' => '%%order_class%% .et_pb_slide .et_pb_slide_image img',
'border_styles' => '%%order_class%% .et_pb_slide .et_pb_slide_image img',
'label_prefix' => et_builder_i18n( 'Image' ),
'tab_slug' => 'advanced',
'toggle_slug' => 'image',
'depends_show_if' => 'off',
'border_radii' => 'on||||',
'border_styles' => array(
'child_filters_target' => array(
'tab_slug' => 'advanced',
'toggle_slug' => 'image',
'main' => '%%order_class%% .et_pb_slide_image',
'main' => '%%order_class%%, %%order_class%% .et_pb_slide',
'use_module_alignment' => false,
'main' => '%%order_class%% .et_pb_slide > .et_pb_container',
'label' => esc_html__( 'Content Width', 'et_builder' ),
'label' => esc_html__( 'Content Max Width', 'et_builder' ),
'position_fields' => array(
$this->custom_css_fields = array(
'slide_description' => array(
'label' => esc_html__( 'Slide Description', 'et_builder' ),
'selector' => '.et_pb_slide_description',
'label' => esc_html__( 'Slide Title', 'et_builder' ),
'selector' => '.et_pb_slide_description .et_pb_slide_title',
'label' => esc_html__( 'Slide Meta', 'et_builder' ),
'selector' => '.et_pb_slide_description .post-meta',
'label' => esc_html__( 'Slide Button', 'et_builder' ),
'selector' => '.et_pb_slider a.et_pb_more_button.et_pb_button',
'no_space_before_selector' => true,
'slide_controllers' => array(
'label' => esc_html__( 'Slide Controllers', 'et_builder' ),
'selector' => '.et-pb-controllers',
'slide_active_controller' => array(
'label' => esc_html__( 'Slide Active Controller', 'et_builder' ),
'selector' => '.et-pb-controllers .et-pb-active-control',
'label' => esc_html__( 'Slide Image', 'et_builder' ),
'selector' => '.et_pb_slide_image',
'label' => esc_html__( 'Slide Arrows', 'et_builder' ),
'selector' => '.et-pb-slider-arrows a',
$this->help_videos = array(
'name' => esc_html__( 'An introduction to the Fullwidth Post Slider module', 'et_builder' ),
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() ) ) {
// 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'] ) {
// 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() ) ) ) {
// 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_row et_pb_no_results">';
$query .= self::get_no_results_template();
$query = array( 'posts' => $query );