: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
* Enqueue styles for block editor
function et_divi_block_editor_styles() {
'divi-block-editor-style',
get_theme_file_uri( '/css/editor-blocks.css' ),
add_action( 'enqueue_block_editor_assets', 'et_divi_block_editor_styles' );
* Setup page layout content width options for block editor
* @param array $content_widths
function et_divi_gb_content_widths( $content_widths = array() ) {
$content_width = absint( et_get_option( 'content_width', '1080' ) ); // pixel
$use_sidebar_width = et_get_option( 'use_sidebar_width', false );
$sidebar_width = $use_sidebar_width ? intval( et_get_option( 'sidebar_width', 21 ) ) : 21; // percentage
$sidebar_padding = 5.5; // percentage
// Content width when no sidebar exist
$no_sidebar = $content_width;
// Content width when sidebar exist (default)
$has_sidebar = absint( ( $content_width / 100 ) * ( 100 - ( $sidebar_width + $sidebar_padding ) ) );
// Min content width (small smartphone width)
// Max content width (15" laptop * 2)
$saved = get_post_meta( get_the_ID(), '_et_gb_content_width', true);
$current = $saved ? $saved : $has_sidebar;
'default' => $has_sidebar,
'et_no_sidebar' => $no_sidebar,
'et_left_sidebar' => $has_sidebar,
'et_right_sidebar' => $has_sidebar,
'et_full_width_page' => $max,
add_filter( 'et_gb_content_widths', 'et_divi_gb_content_widths' );