Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder
File: class-et-builder-element.php
[8000] Fix | Delete
return self::get_unique_bb_key($output);
[8001] Fix | Delete
}
[8002] Fix | Delete
[8003] Fix | Delete
function get_field_renderer( $field ) {
[8004] Fix | Delete
if ( ! isset( $field['type'] ) && ! isset( $field['renderer'] ) ) {
[8005] Fix | Delete
return array();
[8006] Fix | Delete
}
[8007] Fix | Delete
[8008] Fix | Delete
// Make it backward compatible with old 3rd party modules which use custom render methods
[8009] Fix | Delete
$renderer_method = isset( $field['renderer'] ) ? $field['renderer'] : '';
[8010] Fix | Delete
$renderer_with_field = isset( $field['renderer_with_field'] ) ? $field['renderer_with_field'] : false;
[8011] Fix | Delete
$renderer_data = array();
[8012] Fix | Delete
[8013] Fix | Delete
if ( isset( $field['type'] ) ) {
[8014] Fix | Delete
switch( $field['type'] ) {
[8015] Fix | Delete
case 'categories' :
[8016] Fix | Delete
// after 3rd party support release taxonomy name for Shop module has been changed to `product_cat`
[8017] Fix | Delete
// so check also for `product_category` for backward compatibility
[8018] Fix | Delete
if ( isset( $field['taxonomy_name'] ) && self::$_->includes( $field['taxonomy_name'], 'product' ) ) {
[8019] Fix | Delete
$renderer_method = 'et_builder_include_categories_shop_option';
[8020] Fix | Delete
} else {
[8021] Fix | Delete
$renderer_method = 'et_builder_include_categories_option';
[8022] Fix | Delete
}
[8023] Fix | Delete
break;
[8024] Fix | Delete
case 'select_sidebar' :
[8025] Fix | Delete
$renderer_method = 'et_builder_get_widget_areas';
[8026] Fix | Delete
break;
[8027] Fix | Delete
case 'select_icon' :
[8028] Fix | Delete
if ( isset( $field['renderer_options'] ) && isset( $field['renderer_options']['icons_list'] ) && 'icon_down' === $field['renderer_options']['icons_list'] ) {
[8029] Fix | Delete
$renderer_method = 'et_pb_get_font_down_icon_list';
[8030] Fix | Delete
} else {
[8031] Fix | Delete
$renderer_method = 'et_pb_get_font_icon_list';
[8032] Fix | Delete
}
[8033] Fix | Delete
$renderer_with_field = true;
[8034] Fix | Delete
break;
[8035] Fix | Delete
case 'upload_gallery' :
[8036] Fix | Delete
$renderer_method = 'et_builder_get_gallery_settings';
[8037] Fix | Delete
break;
[8038] Fix | Delete
case 'center_map' :
[8039] Fix | Delete
$renderer_method = 'et_builder_generate_center_map_setting';
[8040] Fix | Delete
break;
[8041] Fix | Delete
case 'border-radius' :
[8042] Fix | Delete
$renderer_method = array(
[8043] Fix | Delete
'class' => 'ET_Builder_Module_Field_Template_Border_Radius',
[8044] Fix | Delete
);
[8045] Fix | Delete
break;
[8046] Fix | Delete
case 'composite' :
[8047] Fix | Delete
if ( isset( $field['composite_type'] ) && 'default' === $field['composite_type'] ) {
[8048] Fix | Delete
$renderer_method = array(
[8049] Fix | Delete
'class' => 'ET_Builder_Module_Field_Template_Tabbed',
[8050] Fix | Delete
);
[8051] Fix | Delete
} else if ( isset( $field['composite_type'] ) && 'tabbed' === $field['composite_type'] && 'border' === $field['option_category'] ) {
[8052] Fix | Delete
$renderer_method = array(
[8053] Fix | Delete
'class' => 'ET_Builder_Module_Field_Template_Border_Styles',
[8054] Fix | Delete
);
[8055] Fix | Delete
}
[8056] Fix | Delete
break;
[8057] Fix | Delete
}
[8058] Fix | Delete
}
[8059] Fix | Delete
[8060] Fix | Delete
if ( '' !== $renderer_method ) {
[8061] Fix | Delete
$renderer_data = array(
[8062] Fix | Delete
'renderer' => $renderer_method,
[8063] Fix | Delete
'renderer_options' => isset( $field['renderer_options'] ) ? $field['renderer_options'] : array(),
[8064] Fix | Delete
'renderer_with_field' => $renderer_with_field,
[8065] Fix | Delete
);
[8066] Fix | Delete
}
[8067] Fix | Delete
[8068] Fix | Delete
return apply_filters( 'et_bb_field_renderer_data', $renderer_data, $field );
[8069] Fix | Delete
}
[8070] Fix | Delete
[8071] Fix | Delete
/**
[8072] Fix | Delete
* Prepare module field (option) for use within BB microtemplates.
[8073] Fix | Delete
* The own field renderer can be used.
[8074] Fix | Delete
* @param $field Module field
[8075] Fix | Delete
*
[8076] Fix | Delete
* @return mixed|string Html code of the field
[8077] Fix | Delete
*/
[8078] Fix | Delete
public function wrap_settings_option_field( $field, $name = '' ) {
[8079] Fix | Delete
$use_container_wrapper = isset( $field['use_container_wrapper'] ) && ! $field['use_container_wrapper'] ? false : true;
[8080] Fix | Delete
$field_renderer = $this->get_field_renderer( $field );
[8081] Fix | Delete
[8082] Fix | Delete
if ( ! empty( $field_renderer ) && is_array( $field_renderer['renderer'] ) && ! empty( $field_renderer['renderer']['class'] ) ) {
[8083] Fix | Delete
//cut off 'ET_Builder_Module_Field_Template_' part from renderer definition
[8084] Fix | Delete
$class_name_without_prefix = strtolower ( str_replace ("ET_Builder_Module_Field_Template_", "", $field_renderer['renderer']['class'] ) );
[8085] Fix | Delete
[8086] Fix | Delete
//split class name string by underscore symbol
[8087] Fix | Delete
$file_name_parts = explode( '_', $class_name_without_prefix );
[8088] Fix | Delete
[8089] Fix | Delete
if ( ! empty( $file_name_parts ) ) {
[8090] Fix | Delete
//the first symbol of class name must be uppercase
[8091] Fix | Delete
$last_index = count( $file_name_parts ) - 1;
[8092] Fix | Delete
$file_name_parts[$last_index] = ucwords( $file_name_parts[$last_index] );
[8093] Fix | Delete
[8094] Fix | Delete
//load renderer class from 'module/field/template/' directory accordingly class name and class directory hierarchy
[8095] Fix | Delete
require_once ET_BUILDER_DIR . 'module/field/template/' . implode( DIRECTORY_SEPARATOR, $file_name_parts ) . '.php';
[8096] Fix | Delete
$renderer = new $field_renderer['renderer']['class'];
[8097] Fix | Delete
[8098] Fix | Delete
//before calling the 'render' method make sure the instantiated class is child of 'ET_Builder_Module_Field_Template_Base'
[8099] Fix | Delete
if ( is_subclass_of( $field_renderer['renderer']['class'], "ET_Builder_Module_Field_Template_Base" ) ) {
[8100] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[8101] Fix | Delete
$field_el = call_user_func( array( $renderer, "render" ), $field, $this );
[8102] Fix | Delete
}
[8103] Fix | Delete
}
[8104] Fix | Delete
} else if ( ! empty( $field_renderer ) ) {
[8105] Fix | Delete
$renderer_options = ! empty( $field_renderer['renderer_options'] ) ? $field_renderer['renderer_options'] : $field;
[8106] Fix | Delete
$default_value = isset( $field['default'] ) ? $field['default'] : '';
[8107] Fix | Delete
[8108] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[8109] Fix | Delete
$field_el = is_callable( $field_renderer['renderer'] ) ? call_user_func( $field_renderer['renderer'], $renderer_options, $default_value ) : $field_renderer['renderer'];
[8110] Fix | Delete
[8111] Fix | Delete
if ( ! empty( $field_renderer['renderer_with_field'] ) && $field_renderer['renderer_with_field'] ) {
[8112] Fix | Delete
$field_el .= $this->render_field( $field, $name );
[8113] Fix | Delete
}
[8114] Fix | Delete
} else {
[8115] Fix | Delete
$field_el = $this->render_field( $field, $name );
[8116] Fix | Delete
}
[8117] Fix | Delete
[8118] Fix | Delete
$description = ! empty( $field['description'] ) ? sprintf( '%2$s<p class="description">%1$s</p>', $field['description'], "\n\t\t\t\t\t" ) : '';
[8119] Fix | Delete
[8120] Fix | Delete
if ( '' === $description && ! $use_container_wrapper ) {
[8121] Fix | Delete
$output = $field_el;
[8122] Fix | Delete
} else {
[8123] Fix | Delete
$output = sprintf(
[8124] Fix | Delete
'%3$s<div class="et-pb-option-container et-pb-option-container--%6$s%5$s">
[8125] Fix | Delete
%1$s
[8126] Fix | Delete
%2$s
[8127] Fix | Delete
%4$s</div>',
[8128] Fix | Delete
$field_el,
[8129] Fix | Delete
$description,
[8130] Fix | Delete
"\n\n\t\t\t\t",
[8131] Fix | Delete
"\t",
[8132] Fix | Delete
( isset( $field['type'] ) && 'custom_css' === $field['type'] ? ' et-pb-custom-css-option' : '' ),
[8133] Fix | Delete
isset( $field['type'] ) ? esc_attr( $field['type'] ) : ''
[8134] Fix | Delete
);
[8135] Fix | Delete
}
[8136] Fix | Delete
[8137] Fix | Delete
$dynamic_content_notice = et_get_safe_localization( sprintf(
[8138] Fix | Delete
__( 'This field contains a dynamic value which requires the Visual Builder. <a href="#" class="%1$s">Open Visual Builder</a>', 'et_builder' ),
[8139] Fix | Delete
'et-pb-dynamic-content-fb-switch'
[8140] Fix | Delete
) );
[8141] Fix | Delete
[8142] Fix | Delete
// Conditionally wrap fields depending on whether their values represent dynamic content or not.
[8143] Fix | Delete
$output = sprintf(
[8144] Fix | Delete
'<%% var isDynamic = typeof %1$s !== \'undefined\' && ET_PageBuilder.isDynamicContent(%1$s); %%>
[8145] Fix | Delete
<%% if (isDynamic) { %%>
[8146] Fix | Delete
<div class="et-pb-dynamic-content">
[8147] Fix | Delete
<div class="et-pb-dynamic-content__message">
[8148] Fix | Delete
%2$s
[8149] Fix | Delete
</div>
[8150] Fix | Delete
<div class="et-pb-dynamic-content__field">
[8151] Fix | Delete
<%% } %%>
[8152] Fix | Delete
%3$s
[8153] Fix | Delete
<%% if (isDynamic) { %%>
[8154] Fix | Delete
</div>
[8155] Fix | Delete
</div>
[8156] Fix | Delete
<%% } %%>',
[8157] Fix | Delete
et_core_intentionally_unescaped( $this->get_field_variable_name( $field ), 'underscore_template' ),
[8158] Fix | Delete
et_core_intentionally_unescaped( $this->get_icon( 'lock' ) . $dynamic_content_notice, 'underscore_template'),
[8159] Fix | Delete
et_core_intentionally_unescaped( $output, 'underscore_template' )
[8160] Fix | Delete
);
[8161] Fix | Delete
[8162] Fix | Delete
return $output;
[8163] Fix | Delete
}
[8164] Fix | Delete
[8165] Fix | Delete
function wrap_settings_option_label( $field ) {
[8166] Fix | Delete
if ( ! empty( $field['label'] ) ) {
[8167] Fix | Delete
$label = $field['label'];
[8168] Fix | Delete
} else {
[8169] Fix | Delete
return '';
[8170] Fix | Delete
}
[8171] Fix | Delete
[8172] Fix | Delete
$field_name = $this->get_field_name( $field );
[8173] Fix | Delete
if ( isset( $field['type'] ) && 'font' === $field['type'] ) {
[8174] Fix | Delete
$field_name .= '_select';
[8175] Fix | Delete
}
[8176] Fix | Delete
[8177] Fix | Delete
$required = ! empty( $field['required'] ) ? '<span class="required">*</span>' : '';
[8178] Fix | Delete
$attributes = ! ( isset( $field['type'] ) && in_array( $field['type'], array( 'custom_margin', 'custom_padding' ) ) )
[8179] Fix | Delete
? sprintf( ' for="%1$s"', esc_attr( $field_name ) )
[8180] Fix | Delete
: ' class="et_custom_margin_label"';
[8181] Fix | Delete
[8182] Fix | Delete
$label = sprintf(
[8183] Fix | Delete
'<label%1$s>%2$s%4$s %3$s</label>',
[8184] Fix | Delete
et_core_esc_previously( $attributes ),
[8185] Fix | Delete
et_core_intentionally_unescaped( $label, 'html' ),
[8186] Fix | Delete
et_core_intentionally_unescaped( $required, 'fixed_string' ),
[8187] Fix | Delete
isset( $field['no_colon'] ) && true === $field['no_colon'] ? '' : ':'
[8188] Fix | Delete
);
[8189] Fix | Delete
[8190] Fix | Delete
return $label;
[8191] Fix | Delete
}
[8192] Fix | Delete
[8193] Fix | Delete
/**
[8194] Fix | Delete
* Get svg icon as string
[8195] Fix | Delete
*
[8196] Fix | Delete
* @param string icon name
[8197] Fix | Delete
*
[8198] Fix | Delete
* @return string div-wrapped svg icon
[8199] Fix | Delete
*/
[8200] Fix | Delete
function get_icon( $icon_name ) {
[8201] Fix | Delete
$all_svg_icons = et_pb_get_svg_icons_list();
[8202] Fix | Delete
$icon = isset( $all_svg_icons[ $icon_name ] ) ? $all_svg_icons[ $icon_name ] : '';
[8203] Fix | Delete
[8204] Fix | Delete
if ( '' === $icon ) {
[8205] Fix | Delete
return '';
[8206] Fix | Delete
}
[8207] Fix | Delete
[8208] Fix | Delete
return '<div class="et-pb-icon">
[8209] Fix | Delete
<svg viewBox="0 0 28 28" preserveAspectRatio="xMidYMid meet" shapeRendering="geometricPrecision">' . $icon . '</svg>
[8210] Fix | Delete
</div>';
[8211] Fix | Delete
}
[8212] Fix | Delete
[8213] Fix | Delete
/**
[8214] Fix | Delete
* Get structure of background UI tabs
[8215] Fix | Delete
*
[8216] Fix | Delete
* @return array
[8217] Fix | Delete
*/
[8218] Fix | Delete
function get_background_fields_structure( $base_name = 'background') {
[8219] Fix | Delete
$is_background_attr = 'background' === $base_name;
[8220] Fix | Delete
$use_background_color_gradient = $is_background_attr ? 'use_background_color_gradient' : "{$base_name}_use_color_gradient";
[8221] Fix | Delete
$prefix = $is_background_attr ? '' : "{$base_name}_";
[8222] Fix | Delete
[8223] Fix | Delete
$structure = array(
[8224] Fix | Delete
'color' => array(
[8225] Fix | Delete
"{$base_name}_color",
[8226] Fix | Delete
),
[8227] Fix | Delete
'gradient' => array(
[8228] Fix | Delete
"{$base_name}_color_gradient_start",
[8229] Fix | Delete
"{$base_name}_color_gradient_end",
[8230] Fix | Delete
$use_background_color_gradient,
[8231] Fix | Delete
"{$base_name}_color_gradient_type",
[8232] Fix | Delete
"{$base_name}_color_gradient_direction",
[8233] Fix | Delete
"{$base_name}_color_gradient_direction_radial",
[8234] Fix | Delete
"{$base_name}_color_gradient_start_position",
[8235] Fix | Delete
"{$base_name}_color_gradient_end_position",
[8236] Fix | Delete
"{$base_name}_color_gradient_overlays_image",
[8237] Fix | Delete
),
[8238] Fix | Delete
'image' => array(
[8239] Fix | Delete
"{$base_name}_image",
[8240] Fix | Delete
"{$prefix}parallax",
[8241] Fix | Delete
"{$prefix}parallax_method",
[8242] Fix | Delete
"{$base_name}_size",
[8243] Fix | Delete
"{$base_name}_position",
[8244] Fix | Delete
"{$base_name}_repeat",
[8245] Fix | Delete
"{$base_name}_blend",
[8246] Fix | Delete
),
[8247] Fix | Delete
'video' => array(
[8248] Fix | Delete
"{$base_name}_video_mp4",
[8249] Fix | Delete
"{$base_name}_video_webm",
[8250] Fix | Delete
"{$base_name}_video_width",
[8251] Fix | Delete
"{$base_name}_video_height",
[8252] Fix | Delete
"{$prefix}allow_player_pause",
[8253] Fix | Delete
"{$base_name}_video_pause_outside_viewport",
[8254] Fix | Delete
),
[8255] Fix | Delete
);
[8256] Fix | Delete
[8257] Fix | Delete
if ( $is_background_attr ) {
[8258] Fix | Delete
$structure['color'][] = 'use_background_color';
[8259] Fix | Delete
$structure['image'][] = 'bg_img'; // Column
[8260] Fix | Delete
}
[8261] Fix | Delete
[8262] Fix | Delete
return $structure;
[8263] Fix | Delete
}
[8264] Fix | Delete
[8265] Fix | Delete
/**
[8266] Fix | Delete
* Get list of background fields names in one dimensional array
[8267] Fix | Delete
*
[8268] Fix | Delete
* @return array
[8269] Fix | Delete
*/
[8270] Fix | Delete
function get_background_fields_names() {
[8271] Fix | Delete
$background_structure = $this->get_background_fields_structure();
[8272] Fix | Delete
$fields_names = array();
[8273] Fix | Delete
[8274] Fix | Delete
foreach ( $background_structure as $tab_name ) {
[8275] Fix | Delete
foreach ( $tab_name as $field_name ) {
[8276] Fix | Delete
$fields_names[] = $field_name;
[8277] Fix | Delete
}
[8278] Fix | Delete
}
[8279] Fix | Delete
[8280] Fix | Delete
return $fields_names;
[8281] Fix | Delete
}
[8282] Fix | Delete
[8283] Fix | Delete
/**
[8284] Fix | Delete
* Get / extract background fields from all modules fields
[8285] Fix | Delete
*
[8286] Fix | Delete
* @param array all modules fields
[8287] Fix | Delete
*
[8288] Fix | Delete
* @return array background fields multidimensional array grouped based on its tab
[8289] Fix | Delete
*/
[8290] Fix | Delete
function get_background_fields( $all_fields, $base_name = 'background' ) {
[8291] Fix | Delete
$background_fields_structure = $this->get_background_fields_structure( $base_name );
[8292] Fix | Delete
$background_tab_names = array_keys( $background_fields_structure );
[8293] Fix | Delete
$background_fields = array_fill_keys( $background_tab_names, array() );
[8294] Fix | Delete
[8295] Fix | Delete
foreach ( $all_fields as $field_name => $field ) {
[8296] Fix | Delete
// Multiple foreaches seem overkill. Use single foreach with little bit if conditions
[8297] Fix | Delete
// redundancy to get background fields grouped into multi-dimensional tab-based array
[8298] Fix | Delete
if ( in_array( $field_name, $background_fields_structure['color'] ) ) {
[8299] Fix | Delete
$background_fields['color'][$field_name] = $field;
[8300] Fix | Delete
}
[8301] Fix | Delete
[8302] Fix | Delete
if ( in_array( $field_name, $background_fields_structure['gradient'] ) ) {
[8303] Fix | Delete
$background_fields['gradient'][$field_name] = $field;
[8304] Fix | Delete
}
[8305] Fix | Delete
[8306] Fix | Delete
if ( in_array( $field_name, $background_fields_structure['image'] ) ) {
[8307] Fix | Delete
$background_fields['image'][$field_name] = $field;
[8308] Fix | Delete
}
[8309] Fix | Delete
[8310] Fix | Delete
if ( in_array( $field_name, $background_fields_structure['video'] ) ) {
[8311] Fix | Delete
$background_fields['video'][$field_name] = $field;
[8312] Fix | Delete
}
[8313] Fix | Delete
}
[8314] Fix | Delete
[8315] Fix | Delete
return $background_fields;
[8316] Fix | Delete
}
[8317] Fix | Delete
[8318] Fix | Delete
/**
[8319] Fix | Delete
* Generate background fields based on base name
[8320] Fix | Delete
*
[8321] Fix | Delete
* @since 3.23 Add allowed CSS units for gradient start and end position. Override computed callback.
[8322] Fix | Delete
*
[8323] Fix | Delete
* @param string background base name
[8324] Fix | Delete
* @param string background tab name
[8325] Fix | Delete
* @param string field's tab slug
[8326] Fix | Delete
* @param string field's toggle slug
[8327] Fix | Delete
* @param string field's context
[8328] Fix | Delete
*
[8329] Fix | Delete
* @return array of background fields
[8330] Fix | Delete
*/
[8331] Fix | Delete
function generate_background_options( $base_name = 'background', $background_tab, $tab_slug, $toggle_slug, $context = null ) {
[8332] Fix | Delete
$baseless_prefix = 'background' === $base_name ? '' : "{$base_name}_";
[8333] Fix | Delete
$options = array();
[8334] Fix | Delete
[8335] Fix | Delete
$i18n =& self::$i18n;
[8336] Fix | Delete
[8337] Fix | Delete
if ( ! isset( $i18n['background'] ) ) {
[8338] Fix | Delete
// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
[8339] Fix | Delete
$i18n['background'] = array(
[8340] Fix | Delete
'color' => array(
[8341] Fix | Delete
'label' => esc_html__( 'Background Color', 'et_builder' ),
[8342] Fix | Delete
),
[8343] Fix | Delete
'gradient' => array(
[8344] Fix | Delete
'label' => esc_html__( 'Use Background Color Gradient', 'et_builder' ),
[8345] Fix | Delete
),
[8346] Fix | Delete
'gradient_start' => array(
[8347] Fix | Delete
'label' => esc_html__( 'Gradient Start', 'et_builder' ),
[8348] Fix | Delete
),
[8349] Fix | Delete
'gradient_end' => array(
[8350] Fix | Delete
'label' => esc_html__( 'Gradient End', 'et_builder' ),
[8351] Fix | Delete
),
[8352] Fix | Delete
'gradient_type' => array(
[8353] Fix | Delete
'label' => esc_html__( 'Gradient Type', 'et_builder' ),
[8354] Fix | Delete
'description' => esc_html__( 'Linear gradients radiate in a single direction across one axis. Radial gradients radiate from the center of the background in the shape of a circle.', 'et_builder' ),
[8355] Fix | Delete
),
[8356] Fix | Delete
'gradient_direction' => array(
[8357] Fix | Delete
'label' => esc_html__( 'Gradient Direction', 'et_builder' ),
[8358] Fix | Delete
'description' => esc_html__( 'Change the direction of the gradient by choosing a starting position within a 360 degree range.', 'et_builder' ),
[8359] Fix | Delete
),
[8360] Fix | Delete
'gradient_direction_radial' => array(
[8361] Fix | Delete
'label' => esc_html__( 'Radial Direction', 'et_builder' ),
[8362] Fix | Delete
'description' => esc_html__( 'Change the direction of the gradient by choosing a starting position within a 360 degree range.', 'et_builder' ),
[8363] Fix | Delete
),
[8364] Fix | Delete
'gradient_start_position' => array(
[8365] Fix | Delete
'label' => esc_html__( 'Start Position', 'et_builder' ),
[8366] Fix | Delete
'description' => esc_html__( 'By adjusting the starting position of the gradient, you can control how quickly or slowly each color transitions, and where the transition begins.', 'et_builder' ),
[8367] Fix | Delete
),
[8368] Fix | Delete
'gradient_end_position' => array(
[8369] Fix | Delete
'label' => esc_html__( 'End Position', 'et_builder' ),
[8370] Fix | Delete
'description' => esc_html__( 'By adjusting the ending position of the gradient, you can control how quickly or slowly each color transitions, and where the transition begins.', 'et_builder' ),
[8371] Fix | Delete
),
[8372] Fix | Delete
'gradient_overlay' => array(
[8373] Fix | Delete
'label' => esc_html__( 'Place Gradient Above Background Image', 'et_builder' ),
[8374] Fix | Delete
'description' => esc_html__( 'If enabled, gradient will be positioned on top of background-image', 'et_builder' ),
[8375] Fix | Delete
),
[8376] Fix | Delete
'image' => array(
[8377] Fix | Delete
'label' => esc_html__( 'Background Image', 'et_builder' ),
[8378] Fix | Delete
'choose_text' => esc_attr__( 'Choose a Background Image', 'et_builder' ),
[8379] Fix | Delete
'update_text' => esc_attr__( 'Set As Background', 'et_builder' ),
[8380] Fix | Delete
),
[8381] Fix | Delete
'parallax' => array(
[8382] Fix | Delete
'label' => esc_html__( 'Use Parallax Effect', 'et_builder' ),
[8383] Fix | Delete
'description' => esc_html__( 'If enabled, your background image will stay fixed as your scroll, creating a fun parallax-like effect.', 'et_builder' ),
[8384] Fix | Delete
),
[8385] Fix | Delete
'parallax_method' => array(
[8386] Fix | Delete
'label' => esc_html__( 'Parallax Method', 'et_builder' ),
[8387] Fix | Delete
'description' => esc_html__( 'Define the method, used for the parallax effect.', 'et_builder' ),
[8388] Fix | Delete
'options' => array(
[8389] Fix | Delete
'on' => esc_html__( 'True Parallax', 'et_builder' ),
[8390] Fix | Delete
'off' => esc_html__( 'CSS', 'et_builder' ),
[8391] Fix | Delete
),
[8392] Fix | Delete
),
[8393] Fix | Delete
'size' => array(
[8394] Fix | Delete
'label' => esc_html__( 'Background Image Size', 'et_builder' ),
[8395] Fix | Delete
'description' => esc_html__( 'Choosing "Cover" will force the image to fill the entire background area, clipping the image when necessary. Choosing "Fit" will ensure that the entire image is always visible, but can result in blank spaces around the image. When set to "Actual Size," the image will not be resized at all.', 'et_builder' ),
[8396] Fix | Delete
'options' => array(
[8397] Fix | Delete
'cover' => esc_html__( 'Cover', 'et_builder' ),
[8398] Fix | Delete
'contain' => esc_html__( 'Fit', 'et_builder' ),
[8399] Fix | Delete
'initial' => esc_html__( 'Actual Size', 'et_builder' ),
[8400] Fix | Delete
),
[8401] Fix | Delete
),
[8402] Fix | Delete
'position' => array(
[8403] Fix | Delete
'label' => esc_html__( 'Background Image Position', 'et_builder' ),
[8404] Fix | Delete
'description' => esc_html__( "Choose where you would like the background image to be positioned within this element. You may want to position the background based on the the image's focus point.", 'et_builder' ),
[8405] Fix | Delete
),
[8406] Fix | Delete
'repeat' => array(
[8407] Fix | Delete
'label' => esc_html__( 'Background Image Repeat', 'et_builder' ),
[8408] Fix | Delete
'description' => esc_html__( 'If the background image is smaller than the size of the element, you may want the image to repeat. This result will result in a background image pattern.', 'et_builder' ),
[8409] Fix | Delete
'options' => array(
[8410] Fix | Delete
'no-repeat' => esc_html__( 'No Repeat', 'et_builder' ),
[8411] Fix | Delete
'repeat' => esc_html__( 'Repeat', 'et_builder' ),
[8412] Fix | Delete
'repeat-x' => esc_html__( 'Repeat X (horizontal)', 'et_builder' ),
[8413] Fix | Delete
'repeat-y' => esc_html__( 'Repeat Y (vertical)', 'et_builder' ),
[8414] Fix | Delete
'round' => esc_html__( 'Round', 'et_builder' ),
[8415] Fix | Delete
),
[8416] Fix | Delete
),
[8417] Fix | Delete
'blend' => array(
[8418] Fix | Delete
'label' => esc_html__( 'Background Image Blend', 'et_builder' ),
[8419] Fix | Delete
'description' => esc_html__( 'Background images can be blended with the background color, merging the two and creating unique effects.', 'et_builder' ),
[8420] Fix | Delete
),
[8421] Fix | Delete
'mp4' => array(
[8422] Fix | Delete
'label' => esc_html__( 'Background Video MP4', 'et_builder' ),
[8423] Fix | Delete
'description' => esc_html__( 'All videos should be uploaded in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers. Upload the .MP4 version here.', 'et_builder' ),
[8424] Fix | Delete
'upload_button_text' => esc_attr__( 'Upload a video', 'et_builder' ),
[8425] Fix | Delete
'choose_text' => esc_attr__( 'Choose a Background Video MP4 File', 'et_builder' ),
[8426] Fix | Delete
'update_text' => esc_attr__( 'Set As Background Video', 'et_builder' ),
[8427] Fix | Delete
),
[8428] Fix | Delete
'webm' => array(
[8429] Fix | Delete
'label' => esc_html__( 'Background Video Webm', 'et_builder' ),
[8430] Fix | Delete
'description' => esc_html__( 'All videos should be uploaded in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers. Upload the .WEBM version here.', 'et_builder' ),
[8431] Fix | Delete
'upload_button_text' => esc_attr__( 'Upload a video', 'et_builder' ),
[8432] Fix | Delete
'choose_text' => esc_attr__( 'Choose a Background Video WEBM File', 'et_builder' ),
[8433] Fix | Delete
'update_text' => esc_attr__( 'Set As Background Video', 'et_builder' ),
[8434] Fix | Delete
),
[8435] Fix | Delete
'video_width' => array(
[8436] Fix | Delete
'label' => esc_html__( 'Background Video Width', 'et_builder' ),
[8437] Fix | Delete
'description' => esc_html__( 'In order for videos to be sized correctly, you must input the exact width (in pixels) of your video here.', 'et_builder' ),
[8438] Fix | Delete
),
[8439] Fix | Delete
'video_height' => array(
[8440] Fix | Delete
'label' => esc_html__( 'Background Video Height', 'et_builder' ),
[8441] Fix | Delete
'description' => esc_html__( 'In order for videos to be sized correctly, you must input the exact height (in pixels) of your video here.', 'et_builder' ),
[8442] Fix | Delete
),
[8443] Fix | Delete
'pause' => array(
[8444] Fix | Delete
'label' => esc_html__( 'Pause Video When Another Video Plays', 'et_builder' ),
[8445] Fix | Delete
'description' => esc_html__( 'Allow video to be paused by other players when they begin playing', 'et_builder' ),
[8446] Fix | Delete
),
[8447] Fix | Delete
'viewport' => array(
[8448] Fix | Delete
'label' => esc_html__( 'Pause Video While Not In View', 'et_builder' ),
[8449] Fix | Delete
'description' => esc_html__( 'Allow video to be paused while it is not in the visible area.', 'et_builder' ),
[8450] Fix | Delete
),
[8451] Fix | Delete
);
[8452] Fix | Delete
// phpcs:enable
[8453] Fix | Delete
}
[8454] Fix | Delete
[8455] Fix | Delete
// Not included on skip background tab because background-field is expected to be registered under "background_color" field
[8456] Fix | Delete
if ( in_array( $background_tab, array( 'all', 'button', 'color' ) ) ) {
[8457] Fix | Delete
$options["{$base_name}_color"] = array(
[8458] Fix | Delete
'label' => $i18n['background']['color']['label'],
[8459] Fix | Delete
'type' => 'color-alpha',
[8460] Fix | Delete
'option_category' => 'configuration',
[8461] Fix | Delete
'custom_color' => true,
[8462] Fix | Delete
'tab_slug' => $tab_slug,
[8463] Fix | Delete
'toggle_slug' => $toggle_slug,
[8464] Fix | Delete
'field_template' => 'color',
[8465] Fix | Delete
'hover' => 'tabs',
[8466] Fix | Delete
'last_edited' => 'background',
[8467] Fix | Delete
'mobile_options' => true,
[8468] Fix | Delete
);
[8469] Fix | Delete
[8470] Fix | Delete
// This option is used to enable or disable background color on VB or FE. This option has
[8471] Fix | Delete
// different function with use_background_color. Option background_enable_color won't hide
[8472] Fix | Delete
// background color option like what use_background_color does. It's used to ensure if
[8473] Fix | Delete
// current background should be rendered or not by inheriting or applying custom color.
[8474] Fix | Delete
$options["{$base_name}_enable_color"] = array(
[8475] Fix | Delete
'type' => 'skip',
[8476] Fix | Delete
'tab_slug' => $tab_slug,
[8477] Fix | Delete
'toggle_slug' => $toggle_slug,
[8478] Fix | Delete
'default' => 'on',
[8479] Fix | Delete
'mobile_options' => true,
[8480] Fix | Delete
'hover' => 'tabs',
[8481] Fix | Delete
);
[8482] Fix | Delete
}
[8483] Fix | Delete
[8484] Fix | Delete
if ( in_array( $background_tab, array( 'all', 'button', 'skip', 'gradient' ) ) ) {
[8485] Fix | Delete
$use_background_color_gradient_name = 'background' === $base_name ? 'use_background_color_gradient' : "{$base_name}_use_color_gradient";
[8486] Fix | Delete
[8487] Fix | Delete
$options[ $use_background_color_gradient_name ] = array(
[8488] Fix | Delete
'label' => $i18n['background']['gradient']['label'],
[8489] Fix | Delete
'description' => '',
[8490] Fix | Delete
'type' => 'skip' === $background_tab ? 'skip' : 'yes_no_button',
[8491] Fix | Delete
'option_category' => 'configuration',
[8492] Fix | Delete
'options' => array(
[8493] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[8494] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[8495] Fix | Delete
),
[8496] Fix | Delete
'default' => 'off',
[8497] Fix | Delete
'default_on_child' => true,
[8498] Fix | Delete
'affects' => array(
[8499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function