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
);
[10000] Fix | Delete
[10001] Fix | Delete
$additional_fields .= sprintf( '<input id="%2$s" type="%11$s" class="%3$s%5$s et_pb_setting_mobile et_pb_setting_mobile_%9$s"%6$s%8$s%1$s data-device="%9$s" %4$s%10$s/>%7$s',
[10002] Fix | Delete
$value_mobile,
[10003] Fix | Delete
esc_attr( $field['id'] ) . '_' . $device_type,
[10004] Fix | Delete
esc_attr( $field['class'] ),
[10005] Fix | Delete
$attributes,
[10006] Fix | Delete
( $validate_number ? ' et-validate-number' : '' ), // #5
[10007] Fix | Delete
( $validate_number ? ' maxlength="3"' : '' ),
[10008] Fix | Delete
( ! empty( $field['additional_button'] ) ? $field['additional_button'] : '' ),
[10009] Fix | Delete
( '' !== $default
[10010] Fix | Delete
? sprintf( ' data-default="%1$s"', esc_attr( $default ) )
[10011] Fix | Delete
: ''
[10012] Fix | Delete
),
[10013] Fix | Delete
esc_attr( $device_type ),
[10014] Fix | Delete
$has_saved_value, // #10,
[10015] Fix | Delete
$type
[10016] Fix | Delete
);
[10017] Fix | Delete
}
[10018] Fix | Delete
[10019] Fix | Delete
// Replace value HTML of last edited field. Last edited value maybe an empty
[10020] Fix | Delete
// string on some range input under Shadow settings.
[10021] Fix | Delete
$last_edited_value_html = $default_last_edited_is_arr
[10022] Fix | Delete
? ' value="<%%- typeof( %1$s ) !== \'undefined\' ? %2$s : \'%3$s\' %%>" '
[10023] Fix | Delete
: $value_html;
[10024] Fix | Delete
[10025] Fix | Delete
$value_last_edited = sprintf(
[10026] Fix | Delete
$last_edited_value_html,
[10027] Fix | Delete
esc_attr( $field_var_name . '_last_edited' ),
[10028] Fix | Delete
esc_attr( $field_var_name . '_last_edited' ),
[10029] Fix | Delete
''
[10030] Fix | Delete
);
[10031] Fix | Delete
[10032] Fix | Delete
$class_last_edited = array(
[10033] Fix | Delete
'et_pb_mobile_last_edited_field',
[10034] Fix | Delete
);
[10035] Fix | Delete
[10036] Fix | Delete
$attrs = '';
[10037] Fix | Delete
[10038] Fix | Delete
if ( ! empty( $field['responsive_affects'] ) ) {
[10039] Fix | Delete
$class_last_edited[] = 'et-pb-responsive-affects';
[10040] Fix | Delete
[10041] Fix | Delete
$attrs .= sprintf(
[10042] Fix | Delete
' data-responsive-affects="%1$s" data-responsive-desktop-name="%2$s"',
[10043] Fix | Delete
esc_attr( implode( ', ', $field['responsive_affects'] ) ),
[10044] Fix | Delete
esc_attr( $field['name'] )
[10045] Fix | Delete
);
[10046] Fix | Delete
}
[10047] Fix | Delete
[10048] Fix | Delete
// additional field to save the last edited field which will be opened automatically
[10049] Fix | Delete
$additional_fields .= sprintf( '<input id="%1$s" type="hidden" class="%3$s"%2$s%4$s>',
[10050] Fix | Delete
esc_attr( $field_name . '_last_edited' ),
[10051] Fix | Delete
$value_last_edited,
[10052] Fix | Delete
esc_attr( implode( ' ', $class_last_edited ) ),
[10053] Fix | Delete
$attrs
[10054] Fix | Delete
);
[10055] Fix | Delete
}
[10056] Fix | Delete
[10057] Fix | Delete
if ( 'range' === $field['type'] ) {
[10058] Fix | Delete
$range_value_html = $default_is_arr
[10059] Fix | Delete
? ' value="<%%- typeof( %1$s ) !== \'undefined\' ? %2$s :parseFloat(%3$s) %%>" '
[10060] Fix | Delete
: ' value="<%%- typeof( %1$s ) !== \'undefined\' ? %2$s : parseFloat(\'%3$s\') %%>" ';
[10061] Fix | Delete
$value = sprintf(
[10062] Fix | Delete
$range_value_html,
[10063] Fix | Delete
esc_attr( $field_var_name ),
[10064] Fix | Delete
esc_attr( sprintf( 'parseFloat( %1$s )', $field_var_name ) ),
[10065] Fix | Delete
$default_value
[10066] Fix | Delete
);
[10067] Fix | Delete
$fixed_range = isset($field['fixed_range']) && $field['fixed_range'];
[10068] Fix | Delete
[10069] Fix | Delete
$range_settings_html = '';
[10070] Fix | Delete
$range_properties = apply_filters( 'et_builder_range_properties', array( 'min', 'max', 'step' ) );
[10071] Fix | Delete
foreach ( $range_properties as $property ) {
[10072] Fix | Delete
if ( isset( $field['range_settings'][ $property ] ) ) {
[10073] Fix | Delete
$range_settings_html .= sprintf( ' %2$s="%1$s"',
[10074] Fix | Delete
esc_attr( $field['range_settings'][ $property ] ),
[10075] Fix | Delete
esc_html( $property )
[10076] Fix | Delete
);
[10077] Fix | Delete
}
[10078] Fix | Delete
}
[10079] Fix | Delete
[10080] Fix | Delete
$range_el = sprintf(
[10081] Fix | Delete
'<input type="range" data-name="%7$s" class="et-pb-main-setting et-pb-range%4$s%6$s" data-default="%2$s"%1$s%3$s%5$s %8$s />',
[10082] Fix | Delete
$value,
[10083] Fix | Delete
esc_attr( $default ),
[10084] Fix | Delete
$range_settings_html,
[10085] Fix | Delete
$need_mobile_options ? ' et_pb_setting_mobile et_pb_setting_mobile_desktop et_pb_setting_mobile_active' : '',
[10086] Fix | Delete
$need_mobile_options ? ' data-device="desktop"' : '',
[10087] Fix | Delete
$fixed_range ? ' et-pb-fixed-range' : '',
[10088] Fix | Delete
esc_attr( $field['name'] ),
[10089] Fix | Delete
$unit
[10090] Fix | Delete
);
[10091] Fix | Delete
[10092] Fix | Delete
if ( $need_mobile_options ) {
[10093] Fix | Delete
foreach( array( 'tablet', 'phone' ) as $device_type ) {
[10094] Fix | Delete
// additional data attribute to handle default values for the responsive options
[10095] Fix | Delete
$has_saved_value = sprintf( ' data-has_saved_value="<%%- typeof( %1$s ) !== \'undefined\' ? \'yes\' : \'no\' %%>" ',
[10096] Fix | Delete
esc_attr( $field_var_name . '_' . $device_type )
[10097] Fix | Delete
);
[10098] Fix | Delete
$value_mobile_range = sprintf(
[10099] Fix | Delete
$value_html,
[10100] Fix | Delete
esc_attr( $field_var_name . '_' . $device_type ),
[10101] Fix | Delete
esc_attr( sprintf( 'parseFloat( %1$s )', $field_var_name . '_' . $device_type ) ),
[10102] Fix | Delete
$default_value
[10103] Fix | Delete
);
[10104] Fix | Delete
$range_el .= sprintf(
[10105] Fix | Delete
'<input type="range" class="et-pb-main-setting et-pb-range et_pb_setting_mobile et_pb_setting_mobile_%3$s%6$s" data-default="%1$s"%4$s%2$s data-device="%3$s"%5$s %7$s/>',
[10106] Fix | Delete
esc_attr( $default ),
[10107] Fix | Delete
$range_settings_html,
[10108] Fix | Delete
esc_attr( $device_type ),
[10109] Fix | Delete
$value_mobile_range,
[10110] Fix | Delete
$has_saved_value,
[10111] Fix | Delete
$fixed_range ? ' et-pb-fixed-range' : '',
[10112] Fix | Delete
$unit
[10113] Fix | Delete
);
[10114] Fix | Delete
}
[10115] Fix | Delete
}
[10116] Fix | Delete
[10117] Fix | Delete
$field_el = $range_el . "\n" . $field_el;
[10118] Fix | Delete
}
[10119] Fix | Delete
[10120] Fix | Delete
if ( $need_mobile_options ) {
[10121] Fix | Delete
$field_el = $field_el . $additional_fields;
[10122] Fix | Delete
}
[10123] Fix | Delete
[10124] Fix | Delete
break;
[10125] Fix | Delete
}
[10126] Fix | Delete
[10127] Fix | Delete
if ( isset( $field['has_preview'] ) && $field['has_preview'] ) {
[10128] Fix | Delete
$field_el = sprintf(
[10129] Fix | Delete
'<%%= window.et_builder.options_template_output("option_preview_buttons") %%>
[10130] Fix | Delete
%1$s',
[10131] Fix | Delete
$field_el
[10132] Fix | Delete
);
[10133] Fix | Delete
}
[10134] Fix | Delete
[10135] Fix | Delete
if ( $need_mobile_options ) {
[10136] Fix | Delete
$field_el = $mobile_settings_tabs . "\n" . $field_el;
[10137] Fix | Delete
$field_el .= '<span class="et-pb-mobile-settings-toggle"></span>';
[10138] Fix | Delete
}
[10139] Fix | Delete
[10140] Fix | Delete
if ( isset( $field['type'] ) && isset( $field['tab_slug'] ) && 'advanced' === $field['tab_slug'] && ! $is_custom_color ) {
[10141] Fix | Delete
$field_el .= $reset_button_html;
[10142] Fix | Delete
}
[10143] Fix | Delete
[10144] Fix | Delete
if ( isset( $field['after'] ) && ! $only_options ) {
[10145] Fix | Delete
$field_el .= $this->render_field_before_after_element( $field['after'] );
[10146] Fix | Delete
}
[10147] Fix | Delete
[10148] Fix | Delete
return "\t" . $field_el;
[10149] Fix | Delete
}
[10150] Fix | Delete
[10151] Fix | Delete
public function render_field_before_after_element( $elements ) {
[10152] Fix | Delete
$field_el = '';
[10153] Fix | Delete
$elements = is_array( $elements ) ? $elements : array( $elements );
[10154] Fix | Delete
[10155] Fix | Delete
foreach ( $elements as $element ) {
[10156] Fix | Delete
$attributes = '';
[10157] Fix | Delete
[10158] Fix | Delete
if ( ! empty( $element['attributes'] ) ) {
[10159] Fix | Delete
$this->process_html_attributes( $element, $attributes );
[10160] Fix | Delete
}
[10161] Fix | Delete
[10162] Fix | Delete
switch ( $element['type'] ) {
[10163] Fix | Delete
case 'button':
[10164] Fix | Delete
$class = isset( $element['class'] ) ? esc_attr( $element['class'] ) : '';
[10165] Fix | Delete
$text = isset( $element['text'] ) ? et_core_esc_previously( $element['text'] ) : '';
[10166] Fix | Delete
$field_el .= sprintf( '<button class="button %1$s"%2$s>%3$s</button>', $class, $attributes, $text );
[10167] Fix | Delete
[10168] Fix | Delete
break;
[10169] Fix | Delete
}
[10170] Fix | Delete
}
[10171] Fix | Delete
[10172] Fix | Delete
return $field_el;
[10173] Fix | Delete
}
[10174] Fix | Delete
[10175] Fix | Delete
function render_font_select( $name, $id = '', $group_label ) {
[10176] Fix | Delete
$options_output = '<%= window.et_builder.fonts_template() %>';
[10177] Fix | Delete
$font_weight_output = '<%= window.et_builder.fonts_weight_template() %>';
[10178] Fix | Delete
[10179] Fix | Delete
$output = sprintf(
[10180] Fix | Delete
'<div class="et-pb-select-font-outer" data-group_label="%6$s">
[10181] Fix | Delete
<div class="et-pb-settings-custom-select-wrapper et-pb-settings-option-select-searchable">
[10182] Fix | Delete
<div class="et_pb_select_placeholder"></div>
[10183] Fix | Delete
<ul class="et-pb-settings-option-select et-pb-settings-option-select-advanced et-pb-main-setting">
[10184] Fix | Delete
<li class="et-pb-select-options-filter">
[10185] Fix | Delete
<input type="text" class="et-pb-settings-option-input et-pb-main-setting regular-text et-pb-menu-filter" placeholder="Search Fonts">
[10186] Fix | Delete
</li>
[10187] Fix | Delete
<li class="et_pb_selected_item_container select-option-item">
[10188] Fix | Delete
</li>
[10189] Fix | Delete
<li class="et-pb-option-subgroup et-pb-recent-fonts">
[10190] Fix | Delete
<p class="et-pb-subgroup-title">%4$s</p>
[10191] Fix | Delete
<ul>
[10192] Fix | Delete
</ul>
[10193] Fix | Delete
</li>
[10194] Fix | Delete
%3$s
[10195] Fix | Delete
</ul>
[10196] Fix | Delete
</div>
[10197] Fix | Delete
</div>
[10198] Fix | Delete
%5$s',
[10199] Fix | Delete
esc_attr( $name ),
[10200] Fix | Delete
( ! empty( $id ) ? sprintf(' id="%s"', esc_attr( $id ) ) : '' ),
[10201] Fix | Delete
$options_output . "\n\t\t\t\t\t",
[10202] Fix | Delete
esc_html__( 'Recent', 'et_builder' ),
[10203] Fix | Delete
$font_weight_output,
[10204] Fix | Delete
esc_attr( $group_label )
[10205] Fix | Delete
);
[10206] Fix | Delete
[10207] Fix | Delete
return $output;
[10208] Fix | Delete
}
[10209] Fix | Delete
[10210] Fix | Delete
function render_select( $name, $options, $id = '', $class = '', $attributes = '', $field_type = '', $button_options = array(), $default = '', $only_options = false ) {
[10211] Fix | Delete
$options_output = '';
[10212] Fix | Delete
$processed_options = $options;
[10213] Fix | Delete
[10214] Fix | Delete
if ( 'select_with_option_groups' === $field_type ) {
[10215] Fix | Delete
foreach ( $processed_options as $option_group_name => $option_group ) {
[10216] Fix | Delete
$option_group_name = esc_attr( $option_group_name );
[10217] Fix | Delete
$options_output .= '0' !== $option_group_name ? "<optgroup label='{$option_group_name}'>" : '';
[10218] Fix | Delete
$options_output .= sprintf( '<%%= window.et_builder.options_template_output("select",%1$s,this.model.toJSON()) %%>',
[10219] Fix | Delete
sprintf(
[10220] Fix | Delete
'{select_name: "%1$s", list: %2$s, default: %3$s, }',
[10221] Fix | Delete
$name,
[10222] Fix | Delete
wp_json_encode( $option_group ),
[10223] Fix | Delete
$default
[10224] Fix | Delete
)
[10225] Fix | Delete
);
[10226] Fix | Delete
$options_output .= '0' !== $option_group_name ? '</optgroup>' : '';
[10227] Fix | Delete
}
[10228] Fix | Delete
[10229] Fix | Delete
$class = rtrim( $class );
[10230] Fix | Delete
[10231] Fix | Delete
$name = $id = '';
[10232] Fix | Delete
[10233] Fix | Delete
} else {
[10234] Fix | Delete
$class = rtrim( 'et-pb-main-setting ' . $class );
[10235] Fix | Delete
$options_output .= sprintf( '<%%= window.et_builder.options_template_output("select",%1$s,this.model.toJSON()) %%>',
[10236] Fix | Delete
sprintf(
[10237] Fix | Delete
'{select_name: "%1$s", list: %2$s, default: %3$s, }',
[10238] Fix | Delete
$name,
[10239] Fix | Delete
wp_json_encode( $options ),
[10240] Fix | Delete
$default
[10241] Fix | Delete
)
[10242] Fix | Delete
);
[10243] Fix | Delete
}
[10244] Fix | Delete
[10245] Fix | Delete
$output = sprintf(
[10246] Fix | Delete
'%6$s
[10247] Fix | Delete
<select name="%1$s"%2$s%3$s%4$s class="%3$s %8$s"%9$s>%5$s</select>
[10248] Fix | Delete
%7$s',
[10249] Fix | Delete
esc_attr( $name ),
[10250] Fix | Delete
( ! empty( $id ) ? sprintf(' id="%s"', esc_attr( $id ) ) : '' ),
[10251] Fix | Delete
( ! empty( $class ) ? esc_attr( $class ) : '' ),
[10252] Fix | Delete
( ! empty( $attributes ) ? $attributes : '' ),
[10253] Fix | Delete
$options_output . "\n\t\t\t\t\t",
[10254] Fix | Delete
'yes_no_button' === $field_type ?
[10255] Fix | Delete
sprintf(
[10256] Fix | Delete
'<div class="et_pb_yes_no_button_wrapper %2$s">
[10257] Fix | Delete
%1$s',
[10258] Fix | Delete
sprintf( '<%%= window.et_builder.options_template_output("yes_no_button",%1$s) %%>',
[10259] Fix | Delete
wp_json_encode( array(
[10260] Fix | Delete
'on' => esc_html( $processed_options['on'] ),
[10261] Fix | Delete
'off' => esc_html( $processed_options['off'] ),
[10262] Fix | Delete
) )
[10263] Fix | Delete
),
[10264] Fix | Delete
( ! empty( $button_options['button_type'] ) && 'equal' === $button_options['button_type'] ? ' et_pb_button_equal_sides' : '' )
[10265] Fix | Delete
) : '',
[10266] Fix | Delete
'yes_no_button' === $field_type ? '</div>' : '',
[10267] Fix | Delete
esc_attr( $field_type ),
[10268] Fix | Delete
'' !== $name ? sprintf( ' data-saved_value="<%%= typeof( %1$s ) !== \'undefined\' ? %1$s : \'\' %%>"', esc_attr( str_replace( '-', '_', $name ) ) ) : ''
[10269] Fix | Delete
);
[10270] Fix | Delete
[10271] Fix | Delete
return $only_options ? $options_output : $output;
[10272] Fix | Delete
}
[10273] Fix | Delete
[10274] Fix | Delete
function render_multiple_buttons( $name, $options, $id = '', $class = '', $attributes = '', $value = '', $default = '' ) {
[10275] Fix | Delete
$class = rtrim( 'et-pb-main-setting ' . $class );
[10276] Fix | Delete
[10277] Fix | Delete
$output = sprintf(
[10278] Fix | Delete
'<div class="et_pb_multiple_buttons_wrapper">
[10279] Fix | Delete
<input id="%1$s" name="%7$s" type="hidden" class="%2$s" %3$s%5$s %4$s/>
[10280] Fix | Delete
%6$s
[10281] Fix | Delete
</div>',
[10282] Fix | Delete
esc_attr( $id ),
[10283] Fix | Delete
esc_attr( $class ),
[10284] Fix | Delete
$value,
[10285] Fix | Delete
$attributes,
[10286] Fix | Delete
( '' !== $default
[10287] Fix | Delete
? sprintf( ' data-default=%1$s', esc_attr( $default ) )
[10288] Fix | Delete
: ''
[10289] Fix | Delete
),
[10290] Fix | Delete
sprintf( '<%%= window.et_builder.options_template_output("multiple_buttons",%1$s) %%>',
[10291] Fix | Delete
wp_json_encode( $options )
[10292] Fix | Delete
),
[10293] Fix | Delete
esc_attr( $name )
[10294] Fix | Delete
);
[10295] Fix | Delete
[10296] Fix | Delete
return $output;
[10297] Fix | Delete
}
[10298] Fix | Delete
[10299] Fix | Delete
/**
[10300] Fix | Delete
* @deprecated
[10301] Fix | Delete
*/
[10302] Fix | Delete
function get_main_tabs() {
[10303] Fix | Delete
$tabs = array(
[10304] Fix | Delete
'general' => et_builder_i18n( 'Content' ),
[10305] Fix | Delete
'advanced' => et_builder_i18n( 'Design' ),
[10306] Fix | Delete
'custom_css' => et_builder_i18n( 'Advanced' ),
[10307] Fix | Delete
);
[10308] Fix | Delete
[10309] Fix | Delete
return apply_filters( 'et_builder_main_tabs', $tabs );
[10310] Fix | Delete
}
[10311] Fix | Delete
[10312] Fix | Delete
function get_validation_attr_rules() {
[10313] Fix | Delete
return array(
[10314] Fix | Delete
'minlength',
[10315] Fix | Delete
'maxlength',
[10316] Fix | Delete
'min',
[10317] Fix | Delete
'max',
[10318] Fix | Delete
);
[10319] Fix | Delete
}
[10320] Fix | Delete
[10321] Fix | Delete
function get_validation_class_rules() {
[10322] Fix | Delete
return array(
[10323] Fix | Delete
'required',
[10324] Fix | Delete
'email',
[10325] Fix | Delete
'url',
[10326] Fix | Delete
'date',
[10327] Fix | Delete
'dateISO',
[10328] Fix | Delete
'number',
[10329] Fix | Delete
'digits',
[10330] Fix | Delete
'creditcard',
[10331] Fix | Delete
);
[10332] Fix | Delete
}
[10333] Fix | Delete
[10334] Fix | Delete
function sort_fields( $fields ) {
[10335] Fix | Delete
$tabs_fields = array();
[10336] Fix | Delete
$sorted_fields = array();
[10337] Fix | Delete
$i = 0;
[10338] Fix | Delete
[10339] Fix | Delete
// Sort fields array by tab name
[10340] Fix | Delete
foreach ( $fields as $field_slug => $field_options ) {
[10341] Fix | Delete
// Option template replaces field's array configuration into string which refers to
[10342] Fix | Delete
// saved template data & template id; thus add index order if $field_options is array.
[10343] Fix | Delete
if ( is_array( $field_options ) ) {
[10344] Fix | Delete
$field_options['_order_number'] = $i;
[10345] Fix | Delete
}
[10346] Fix | Delete
[10347] Fix | Delete
$tab_slug = ! empty( $field_options['tab_slug'] ) ? $field_options['tab_slug'] : 'general';
[10348] Fix | Delete
$tabs_fields[ $tab_slug ][ $field_slug ] = $field_options;
[10349] Fix | Delete
[10350] Fix | Delete
$i++;
[10351] Fix | Delete
}
[10352] Fix | Delete
[10353] Fix | Delete
// Sort fields within tabs by priority
[10354] Fix | Delete
foreach ( $tabs_fields as $tab_fields ) {
[10355] Fix | Delete
uasort( $tab_fields, array( 'self', 'compare_by_priority' ) );
[10356] Fix | Delete
$sorted_fields = array_merge( $sorted_fields, $tab_fields );
[10357] Fix | Delete
}
[10358] Fix | Delete
[10359] Fix | Delete
return $sorted_fields;
[10360] Fix | Delete
}
[10361] Fix | Delete
[10362] Fix | Delete
function get_options() {
[10363] Fix | Delete
$output = '';
[10364] Fix | Delete
$toggle_all_options_slug = 'all_options';
[10365] Fix | Delete
$toggles_used = isset( $this->settings_modal_toggles );
[10366] Fix | Delete
$tabs_output = array( 'general' => array() );
[10367] Fix | Delete
$all_fields = $this->sort_fields( $this->_get_fields() );
[10368] Fix | Delete
$all_fields_keys = array_keys( $all_fields );
[10369] Fix | Delete
$background_fields_names = $this->get_background_fields_names();
[10370] Fix | Delete
$module_has_background_color_field = in_array( 'background_color', $all_fields_keys );
[10371] Fix | Delete
[10372] Fix | Delete
$all_toggles = self::get_toggles( 'post' );
[10373] Fix | Delete
[10374] Fix | Delete
foreach( $all_fields as $field_name => $field ) {
[10375] Fix | Delete
if ( ! empty( $field['type'] ) && ( 'skip' === $field['type'] || 'computed' === $field['type'] ) ) {
[10376] Fix | Delete
continue;
[10377] Fix | Delete
}
[10378] Fix | Delete
[10379] Fix | Delete
if ( ! self::$_->array_get( $field, 'bb_support', true ) ) {
[10380] Fix | Delete
continue;
[10381] Fix | Delete
}
[10382] Fix | Delete
[10383] Fix | Delete
// add only options allowed for current user
[10384] Fix | Delete
if (
[10385] Fix | Delete
( ! et_pb_is_allowed( 'edit_colors' ) && ( ! empty( $field['type'] ) && in_array( $field['type'], array( 'color', 'color-alpha' ) ) || ( ! empty( $field['option_category'] ) && 'color_option' === $field['option_category'] ) ) )
[10386] Fix | Delete
||
[10387] Fix | Delete
( ! et_pb_is_allowed( 'edit_content' ) && ! empty( $field['option_category'] ) && 'basic_option' === $field['option_category'] )
[10388] Fix | Delete
||
[10389] Fix | Delete
( ! et_pb_is_allowed( 'edit_layout' ) && ! empty( $field['option_category'] ) && 'layout' === $field['option_category'] )
[10390] Fix | Delete
||
[10391] Fix | Delete
( ! et_pb_is_allowed( 'edit_configuration' ) && ! empty( $field['option_category'] ) && 'configuration' === $field['option_category'] )
[10392] Fix | Delete
||
[10393] Fix | Delete
( ! et_pb_is_allowed( 'edit_fonts' ) && ! empty( $field['option_category'] ) && ( 'font_option' === $field['option_category'] || ( 'button' === $field['option_category'] && ! empty( $field['type'] ) && 'font' === $field['type'] ) ) )
[10394] Fix | Delete
||
[10395] Fix | Delete
( ! et_pb_is_allowed( 'edit_buttons' ) && ! empty( $field['option_category'] ) && 'button' === $field['option_category'] )
[10396] Fix | Delete
||
[10397] Fix | Delete
( ! et_pb_is_allowed( 'edit_borders' ) && ! empty( $field['option_category'] ) && 'border' === $field['option_category'] )
[10398] Fix | Delete
) {
[10399] Fix | Delete
continue;
[10400] Fix | Delete
}
[10401] Fix | Delete
[10402] Fix | Delete
// check for allowed 3rd party custom options categories
[10403] Fix | Delete
if ( ! empty( $field['option_category'] ) && ! et_pb_is_allowed( $field['option_category'] ) ) {
[10404] Fix | Delete
continue;
[10405] Fix | Delete
}
[10406] Fix | Delete
[10407] Fix | Delete
$option_output = '';
[10408] Fix | Delete
[10409] Fix | Delete
if ( 'background_color' === $field_name ) {
[10410] Fix | Delete
$background_fields_ui = $this->wrap_settings_background_fields( $all_fields );
[10411] Fix | Delete
[10412] Fix | Delete
// Append background fields UI if applicable. Append standard option otherwise
[10413] Fix | Delete
if ( '' !== $background_fields_ui ) {
[10414] Fix | Delete
// unset depends_show_if because background fields visibility handled in Background UI.
[10415] Fix | Delete
unset( $field['depends_show_if'] );
[10416] Fix | Delete
// append background UI
[10417] Fix | Delete
$option_output .= $background_fields_ui;
[10418] Fix | Delete
} else {
[10419] Fix | Delete
$field['skip_background_ui'] = true;
[10420] Fix | Delete
$option_output .= $this->wrap_settings_option_label( $field );
[10421] Fix | Delete
$option_output .= $this->wrap_settings_option_field( $field );
[10422] Fix | Delete
}
[10423] Fix | Delete
} elseif ( $module_has_background_color_field && in_array( $field_name , $background_fields_names ) ) {
[10424] Fix | Delete
// remove background-related fields from setting modals since it'll be printed by background UI
[10425] Fix | Delete
continue;
[10426] Fix | Delete
} else {
[10427] Fix | Delete
// append normal fields
[10428] Fix | Delete
$option_output .= $this->wrap_settings_option_label( $field );
[10429] Fix | Delete
$option_output .= $this->wrap_settings_option_field( $field );
[10430] Fix | Delete
}
[10431] Fix | Delete
[10432] Fix | Delete
$tab_slug = ! empty( $field['tab_slug'] ) ? $field['tab_slug'] : 'general';
[10433] Fix | Delete
$is_toggle_option = isset( $field['toggle_slug'] ) && $toggles_used && isset( $this->settings_modal_toggles[ $tab_slug ] );
[10434] Fix | Delete
$toggle_slug = $is_toggle_option ? $field['toggle_slug'] : $toggle_all_options_slug;
[10435] Fix | Delete
$sub_toggle_slug = 'all_options' !== $toggle_slug && isset( $field['sub_toggle'] ) && '' !== $field['sub_toggle'] ? $field['sub_toggle'] : 'main';
[10436] Fix | Delete
$tabs_output[ $tab_slug ][ $toggle_slug ][ $sub_toggle_slug ][] = $this->wrap_settings_option( $option_output, $field, $field_name );
[10437] Fix | Delete
[10438] Fix | Delete
if ( isset( $field['toggle_slug'] ) && ! isset( $this->settings_modal_toggles[ $tab_slug ]['toggles'][ $toggle_slug ] ) ) {
[10439] Fix | Delete
if ( $toggle = self::$_->array_get( $all_toggles, "{$this->slug}.{$tab_slug}.toggles.{$field['toggle_slug']}" ) ) {
[10440] Fix | Delete
self::$_->array_set( $this->settings_modal_toggles, "{$tab_slug}.toggles.{$toggle_slug}", $toggle );
[10441] Fix | Delete
}
[10442] Fix | Delete
}
[10443] Fix | Delete
}
[10444] Fix | Delete
[10445] Fix | Delete
$default_tabs_keys = array_keys( $this->main_tabs );
[10446] Fix | Delete
$module_tabs_keys = array_keys( $tabs_output );
[10447] Fix | Delete
$module_default_tabs = array_intersect( $default_tabs_keys, $module_tabs_keys );
[10448] Fix | Delete
$module_custom_tabs = array_diff( $module_tabs_keys, $default_tabs_keys );
[10449] Fix | Delete
[10450] Fix | Delete
// Make sure tabs order is correct for BB, i.e. custom tabs goes after default tabs and default tabs in following order:
[10451] Fix | Delete
// `Content`, `Design`, `Advanced`
[10452] Fix | Delete
$module_tabs_sorted = array_merge( $module_default_tabs, $module_custom_tabs );
[10453] Fix | Delete
$tabs_output_processed = array();
[10454] Fix | Delete
[10455] Fix | Delete
// reorder tabs to be sure they're correct
[10456] Fix | Delete
foreach( $module_tabs_sorted as $tab_slug ) {
[10457] Fix | Delete
$tabs_output_processed[ $tab_slug ] = $tabs_output[ $tab_slug ];
[10458] Fix | Delete
}
[10459] Fix | Delete
[10460] Fix | Delete
foreach ( $tabs_output_processed as $tab_slug => $tab_settings ) {
[10461] Fix | Delete
// Add only tabs allowed for current user
[10462] Fix | Delete
if ( ! et_pb_is_allowed( $tab_slug . '_settings' ) ) {
[10463] Fix | Delete
continue;
[10464] Fix | Delete
}
[10465] Fix | Delete
[10466] Fix | Delete
$tab_output = '';
[10467] Fix | Delete
$this->used_tabs[] = $tab_slug;
[10468] Fix | Delete
$i = 0;
[10469] Fix | Delete
[10470] Fix | Delete
if ( isset( $tabs_output_processed[ $tab_slug ] ) ) {
[10471] Fix | Delete
// Group field with no explicit toggle_slug then append it on top of other toggles
[10472] Fix | Delete
if ( isset( $tabs_output_processed[ $tab_slug ][ $toggle_all_options_slug ] ) ) {
[10473] Fix | Delete
$toggle_unclassified_output = '';
[10474] Fix | Delete
[10475] Fix | Delete
foreach ( $tabs_output_processed[ $tab_slug ][ $toggle_all_options_slug ] as $no_toggle_option_data ) {
[10476] Fix | Delete
foreach( $no_toggle_option_data as $subtoggle_id => $no_toggle_option_output ) {
[10477] Fix | Delete
$toggle_unclassified_output .= $no_toggle_option_output;
[10478] Fix | Delete
}
[10479] Fix | Delete
}
[10480] Fix | Delete
[10481] Fix | Delete
$tab_output .= sprintf(
[10482] Fix | Delete
'<div class="et-pb-options-toggle-container et-pb-options-toggle-disabled">
[10483] Fix | Delete
<h3 class="et-pb-option-toggle-title">%1$s</h3>
[10484] Fix | Delete
<div class="et-pb-option-toggle-content">
[10485] Fix | Delete
%2$s
[10486] Fix | Delete
</div>
[10487] Fix | Delete
</div>',
[10488] Fix | Delete
esc_html__( $this->name, 'et_builder' ),
[10489] Fix | Delete
et_core_esc_previously( $toggle_unclassified_output ),
[10490] Fix | Delete
'et-pb-options-toggle-disabled'
[10491] Fix | Delete
);
[10492] Fix | Delete
}
[10493] Fix | Delete
[10494] Fix | Delete
if ( isset( $this->settings_modal_toggles[ $tab_slug ] ) ) {
[10495] Fix | Delete
$this->settings_modal_toggles[ $tab_slug ]['toggles'] = self::et_pb_order_toggles_by_priority( $this->settings_modal_toggles[ $tab_slug ]['toggles'] );
[10496] Fix | Delete
[10497] Fix | Delete
foreach ( $this->settings_modal_toggles[ $tab_slug ]['toggles'] as $toggle_slug => $toggle_data ) {
[10498] Fix | Delete
$toggle_heading = is_array( $toggle_data ) ? $toggle_data['title'] : $toggle_data;
[10499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function