: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'priority' => $this->module->get_style_priority(),
) + $this->get_media_query( $type ) );
$offsets = array( 'vertical', 'horizontal' );
foreach ( $offsets as $offsetSlug ) {
$field_slug = "${offsetSlug}_offset";
$is_hover = 'hover' === $type && $hover_status[ $offsetSlug ];
$is_responsive = in_array( $type, array( 'tablet', 'phone' ) ) && $resp_status[ $offsetSlug ];
$offset_view = $is_hover ? 'hover' : ( $is_responsive ? $type : 'desktop' );
$value = esc_attr( $this->get_value( $props, $field_slug, '0px', $offset_view, true ) );
if ( 'desktop' === $offset_view && $is_default_position && 'top_left' === $active_origin && '0px' === $value ) {
$origin_array = explode( '_', $active_origin );
$inverse_property = 'right';
if ( 'horizontal' === $offsetSlug ) {
if ( 'center' === $origin_array[1] ) {
} elseif ( 'right' === $origin_array[1] ) {
$inverse_property = 'left';
$inverse_property = 'bottom';
if ( 'center' === $origin_array[0] ) {
} elseif ( 'bottom' === $origin_array[0] ) {
$inverse_property = 'top';
// add the adminbar height offset to avoid overflow of fixed elements.
$active_position = $this->get_value( $props, 'positioning', $position_default, $type, true );
if ( 'top' === $property ) {
$admin_bar_declaration = "$property: $value";
if ( 'fixed' === $active_position ) {
$admin_bar_height = 'phone' === $type ? '46px' : '32px';
$admin_bar_declaration = "$property: calc($value + $admin_bar_height);";
if ( 'desktop' !== $type || 'fixed' === $active_position ) {
ET_Builder_Element::set_style( $function_name,
'selector' => "body.logged-in.admin-bar $type_selector",
'declaration' => $admin_bar_declaration,
'priority' => $this->module->get_style_priority(),
) + $this->get_media_query( $type ) );
if ( 'top' === $inverse_property && ( 'desktop' !== $type || 'fixed' === $active_position ) ) {
ET_Builder_Element::set_style( $function_name,
'selector' => "body.logged-in.admin-bar $type_selector",
'declaration' => "$inverse_property: auto",
'priority' => $this->module->get_style_priority(),
) + $this->get_media_query( $type ) );
ET_Builder_Element::set_style( $function_name,
'selector' => $type_selector,
'declaration' => "$property: $value;",
'priority' => $this->module->get_style_priority(),
) + $this->get_media_query( $type ) );
ET_Builder_Element::set_style( $function_name,
'selector' => $type_selector,
'declaration' => "$inverse_property: auto;",
'priority' => $this->module->get_style_priority(),
) + $this->get_media_query( $type ) );
if ( $has_z_index && ( ! is_array( $position_config ) || ! $has_position ) ) {
// Backwards compatibility. Before this feature if z-index was set, position got defaulted as relative
ET_Builder_Element::set_style( $function_name,
'selector' => '%%order_class%%',
'declaration' => "position: relative;",
'priority' => $this->module->get_style_priority(),
return new ET_Builder_Module_Field_Position();