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
if ( ! isset( $tabs_output_processed[ $tab_slug ][ $toggle_slug ] ) ) {
[10500] Fix | Delete
continue;
[10501] Fix | Delete
}
[10502] Fix | Delete
[10503] Fix | Delete
$i++;
[10504] Fix | Delete
$toggle_output = '';
[10505] Fix | Delete
$is_accordion_enabled = isset( $this->settings_modal_toggles[ $tab_slug ]['settings']['bb_toggles_enabeld'] ) && $this->settings_modal_toggles[ $tab_slug ]['settings']['bb_toggles_enabled'] ? true : false;
[10506] Fix | Delete
$is_tabbed_subtoggles = isset( $toggle_data['tabbed_subtoggles'] );
[10507] Fix | Delete
$is_bb_icons_support = isset( $toggle_data['bb_icons_support'] );
[10508] Fix | Delete
$subtoggle_tabs_nav = '';
[10509] Fix | Delete
[10510] Fix | Delete
if ( is_array( $toggle_data ) && ! empty( $toggle_data ) ) {
[10511] Fix | Delete
if ( ! isset( $toggle_data['sub_toggles'] ) ) {
[10512] Fix | Delete
$toggle_data['sub_toggles'] = array( 'main' => '' );
[10513] Fix | Delete
}
[10514] Fix | Delete
[10515] Fix | Delete
foreach( $toggle_data['sub_toggles'] as $sub_toggle_id => $sub_toggle_data ) {
[10516] Fix | Delete
if ( ! isset( $tabs_output_processed[ $tab_slug ][ $toggle_slug ][ $sub_toggle_id ] ) ) {
[10517] Fix | Delete
continue;
[10518] Fix | Delete
}
[10519] Fix | Delete
[10520] Fix | Delete
if ( $is_tabbed_subtoggles ) {
[10521] Fix | Delete
$subtoggle_tabs_nav .= sprintf(
[10522] Fix | Delete
'<li class="subtoggle_tabs_nav_item"><a class="subtoggle_tabs_nav_item_inner%3$s" data-tab_id="%1$s">%2$s</a></li>',
[10523] Fix | Delete
$sub_toggle_id,
[10524] Fix | Delete
$is_bb_icons_support ? '' : esc_html( $sub_toggle_data['name'] ),
[10525] Fix | Delete
$is_bb_icons_support ? sprintf( ' subtoggle_tabs_nav_icon subtoggle_tabs_nav_icon-%1$s', esc_attr( $sub_toggle_data['icon'] ) ) : ''
[10526] Fix | Delete
);
[10527] Fix | Delete
}
[10528] Fix | Delete
[10529] Fix | Delete
$subtoggle_options = '';
[10530] Fix | Delete
[10531] Fix | Delete
foreach ( $tabs_output_processed[ $tab_slug ][ $toggle_slug ][ $sub_toggle_id ] as $toggle_option_output ) {
[10532] Fix | Delete
$subtoggle_options .= $toggle_option_output;
[10533] Fix | Delete
}
[10534] Fix | Delete
[10535] Fix | Delete
if ( 'main' === $sub_toggle_id ) {
[10536] Fix | Delete
$toggle_output .= $subtoggle_options;
[10537] Fix | Delete
} else {
[10538] Fix | Delete
$toggle_output .= sprintf(
[10539] Fix | Delete
'<div class="et_pb_subtoggle_section%2$s"%3$s>
[10540] Fix | Delete
%1$s
[10541] Fix | Delete
</div>',
[10542] Fix | Delete
$subtoggle_options,
[10543] Fix | Delete
$is_tabbed_subtoggles ? ' et_pb_tabbed_subtoggle' : '',
[10544] Fix | Delete
$is_tabbed_subtoggles ? sprintf( ' data-tab_id="%1$s"', esc_attr( $sub_toggle_id ) ) : ''
[10545] Fix | Delete
);
[10546] Fix | Delete
}
[10547] Fix | Delete
}
[10548] Fix | Delete
} else {
[10549] Fix | Delete
foreach ( $tabs_output_processed[ $tab_slug ][ $toggle_slug ] as $toggle_option_id => $toggle_option_data ) {
[10550] Fix | Delete
foreach( $toggle_option_data as $toggle_option_output ) {
[10551] Fix | Delete
$toggle_output .= $toggle_option_output;
[10552] Fix | Delete
}
[10553] Fix | Delete
}
[10554] Fix | Delete
}
[10555] Fix | Delete
[10556] Fix | Delete
if ( '' === $toggle_output ) {
[10557] Fix | Delete
continue;
[10558] Fix | Delete
}
[10559] Fix | Delete
[10560] Fix | Delete
$toggle_output = sprintf(
[10561] Fix | Delete
'<div class="et-pb-options-toggle-container%3$s%4$s%5$s">
[10562] Fix | Delete
<h3 class="et-pb-option-toggle-title">%1$s</h3>
[10563] Fix | Delete
%6$s
[10564] Fix | Delete
<div class="et-pb-option-toggle-content">
[10565] Fix | Delete
%2$s
[10566] Fix | Delete
</div>
[10567] Fix | Delete
</div>',
[10568] Fix | Delete
esc_html( $toggle_heading ),
[10569] Fix | Delete
$toggle_output,
[10570] Fix | Delete
( $is_accordion_enabled ? ' et-pb-options-toggle-enabled' : ' et-pb-options-toggle-disabled' ),
[10571] Fix | Delete
( 1 === $i && $is_accordion_enabled ? ' et-pb-option-toggle-content-open' : '' ),
[10572] Fix | Delete
$is_tabbed_subtoggles ? ' et_pb_contains_tabbed_subtoggle' : '',
[10573] Fix | Delete
$is_tabbed_subtoggles && '' !== $subtoggle_tabs_nav ? sprintf( '<ul class="subtoggle_tabs_nav">%1$s</ul>', $subtoggle_tabs_nav ) : ''
[10574] Fix | Delete
);
[10575] Fix | Delete
[10576] Fix | Delete
$tab_output .= $toggle_output;
[10577] Fix | Delete
}
[10578] Fix | Delete
}
[10579] Fix | Delete
}
[10580] Fix | Delete
[10581] Fix | Delete
$output .= sprintf(
[10582] Fix | Delete
'<div class="et-pb-options-tab et-pb-options-tab-%1$s">
[10583] Fix | Delete
%3$s
[10584] Fix | Delete
%2$s
[10585] Fix | Delete
</div>',
[10586] Fix | Delete
esc_attr( $tab_slug ),
[10587] Fix | Delete
$tab_output,
[10588] Fix | Delete
( 'general' === $tab_slug ? $this->children_settings() : '' )
[10589] Fix | Delete
);
[10590] Fix | Delete
}
[10591] Fix | Delete
[10592] Fix | Delete
// return error message if no tabs allowed for current user
[10593] Fix | Delete
if ( '' === $output ) {
[10594] Fix | Delete
$output = esc_html__( "You don't have sufficient permissions to access the settings", 'et_builder' );
[10595] Fix | Delete
}
[10596] Fix | Delete
[10597] Fix | Delete
return $output;
[10598] Fix | Delete
}
[10599] Fix | Delete
[10600] Fix | Delete
function children_settings() {
[10601] Fix | Delete
$output = '';
[10602] Fix | Delete
[10603] Fix | Delete
if ( ! empty( $this->child_slug ) ) {
[10604] Fix | Delete
$child_module = self::get_module( $this->child_slug );
[10605] Fix | Delete
[10606] Fix | Delete
if ( isset( $child_module->bb_support ) && ! $child_module->bb_support ) {
[10607] Fix | Delete
return $output;
[10608] Fix | Delete
}
[10609] Fix | Delete
[10610] Fix | Delete
$output = sprintf(
[10611] Fix | Delete
'%6$s<div class="et-pb-option-advanced-module-settings" data-module_type="%1$s">
[10612] Fix | Delete
<ul class="et-pb-sortable-options">
[10613] Fix | Delete
</ul>
[10614] Fix | Delete
%2$s
[10615] Fix | Delete
</div>
[10616] Fix | Delete
<div class="et-pb-option et-pb-option-main-content et-pb-option-advanced-module">
[10617] Fix | Delete
<label for="et_pb_content">%3$s</label>
[10618] Fix | Delete
<div class="et-pb-option-container">
[10619] Fix | Delete
<div id="et_pb_content"><%%= typeof( et_pb_content )!== \'undefined\' && \'\' !== et_pb_content.trim() ? et_pb_content : \'%7$s\' %%></div>
[10620] Fix | Delete
<p class="description">%4$s</p>
[10621] Fix | Delete
</div>
[10622] Fix | Delete
</div>%5$s',
[10623] Fix | Delete
esc_attr( $this->child_slug ),
[10624] Fix | Delete
! in_array( $this->child_slug, array( 'et_pb_column', 'et_pb_column_inner' ) ) ? sprintf( '<a href="#" class="et-pb-add-sortable-option"><span>%1$s</span></a>', esc_html( $this->add_new_child_text() ) ) : '',
[10625] Fix | Delete
et_builder_i18n( 'Content' ),
[10626] Fix | Delete
esc_html__( 'Here you can define the content that will be placed within the current tab.', 'et_builder' ),
[10627] Fix | Delete
"\n\n",
[10628] Fix | Delete
"\t",
[10629] Fix | Delete
$this->predefined_child_modules()
[10630] Fix | Delete
);
[10631] Fix | Delete
}
[10632] Fix | Delete
[10633] Fix | Delete
return $output;
[10634] Fix | Delete
}
[10635] Fix | Delete
[10636] Fix | Delete
function add_new_child_text() {
[10637] Fix | Delete
$child_slug = ! empty( $this->child_item_text ) ? $this->child_item_text : '';
[10638] Fix | Delete
[10639] Fix | Delete
$child_slug = '' === $child_slug ? esc_html__( 'Add New Item', 'et_builder' ) : sprintf( esc_html__( 'Add New %s', 'et_builder' ), $child_slug );
[10640] Fix | Delete
[10641] Fix | Delete
return $child_slug;
[10642] Fix | Delete
}
[10643] Fix | Delete
[10644] Fix | Delete
function wrap_settings( $output ) {
[10645] Fix | Delete
$tabs_output = '';
[10646] Fix | Delete
$i = 0;
[10647] Fix | Delete
$tabs = array();
[10648] Fix | Delete
[10649] Fix | Delete
// General Settings Tab should be added to all modules if allowed
[10650] Fix | Delete
if ( et_pb_is_allowed( 'general_settings' ) ) {
[10651] Fix | Delete
$tabs['general'] = isset( $this->main_tabs['general'] ) ? $this->main_tabs['general'] : esc_html__( 'General Settings', 'et_builder' );
[10652] Fix | Delete
}
[10653] Fix | Delete
[10654] Fix | Delete
foreach ( $this->used_tabs as $tab_slug ) {
[10655] Fix | Delete
if ( 'general' === $tab_slug ) {
[10656] Fix | Delete
continue;
[10657] Fix | Delete
}
[10658] Fix | Delete
[10659] Fix | Delete
// Add only tabs allowed for current user
[10660] Fix | Delete
if ( et_pb_is_allowed( $tab_slug . '_settings' ) ) {
[10661] Fix | Delete
if ( isset( $this->main_tabs[ $tab_slug ] ) ) {
[10662] Fix | Delete
// if it's one of 3 default tabs
[10663] Fix | Delete
$tabs[ $tab_slug ] = $this->main_tabs[ $tab_slug ];
[10664] Fix | Delete
} else {
[10665] Fix | Delete
// Use tab name if it's properly registered custom tab. Fallback to tab slug otherwise
[10666] Fix | Delete
$tabs[ $tab_slug ] = isset( $this->settings_modal_tabs ) && isset( $this->settings_modal_tabs[ $tab_slug ] ) ? $this->settings_modal_tabs[ $tab_slug ]['name'] : $tab_slug;
[10667] Fix | Delete
}
[10668] Fix | Delete
}
[10669] Fix | Delete
}
[10670] Fix | Delete
[10671] Fix | Delete
$tabs_array = array();
[10672] Fix | Delete
$tabs_json = '';
[10673] Fix | Delete
[10674] Fix | Delete
foreach ( $tabs as $tab_slug => $tab_name ) {
[10675] Fix | Delete
$i++;
[10676] Fix | Delete
[10677] Fix | Delete
$tabs_array[$i] = array(
[10678] Fix | Delete
'slug' => $tab_slug,
[10679] Fix | Delete
'label' => $tab_name,
[10680] Fix | Delete
);
[10681] Fix | Delete
[10682] Fix | Delete
$tabs_json = wp_json_encode( $tabs_array );
[10683] Fix | Delete
}
[10684] Fix | Delete
[10685] Fix | Delete
$tabs_output = sprintf( '<%%= window.et_builder.settings_tabs_output(%1$s) %%>', $tabs_json );
[10686] Fix | Delete
$preview_tabs_output = '<%= window.et_builder.preview_tabs_output() %>';
[10687] Fix | Delete
[10688] Fix | Delete
$output = sprintf(
[10689] Fix | Delete
'%2$s
[10690] Fix | Delete
%3$s
[10691] Fix | Delete
<div class="et-pb-options-tabs">
[10692] Fix | Delete
%1$s
[10693] Fix | Delete
</div>
[10694] Fix | Delete
<div class="et-pb-preview-tab"></div>
[10695] Fix | Delete
',
[10696] Fix | Delete
$output,
[10697] Fix | Delete
$tabs_output,
[10698] Fix | Delete
$preview_tabs_output
[10699] Fix | Delete
);
[10700] Fix | Delete
[10701] Fix | Delete
return sprintf(
[10702] Fix | Delete
'%2$s<div class="et-pb-main-settings">%1$s</div>%3$s',
[10703] Fix | Delete
"\n\t\t" . $output,
[10704] Fix | Delete
"\n\t\t",
[10705] Fix | Delete
"\n"
[10706] Fix | Delete
);
[10707] Fix | Delete
}
[10708] Fix | Delete
[10709] Fix | Delete
function wrap_validation_form( $output ) {
[10710] Fix | Delete
return '<form class="et-builder-main-settings-form validate">' . $output . '</form>';
[10711] Fix | Delete
}
[10712] Fix | Delete
[10713] Fix | Delete
/**
[10714] Fix | Delete
* Get the module's props mapped to their default values.
[10715] Fix | Delete
*
[10716] Fix | Delete
* @since 3.1 Renamed from `get_shortcode_fields()` to `get_default_props()`.
[10717] Fix | Delete
* @since 1.0
[10718] Fix | Delete
*
[10719] Fix | Delete
* @return array
[10720] Fix | Delete
*/
[10721] Fix | Delete
public function get_default_props() {
[10722] Fix | Delete
if ( method_exists( $this, 'get_shortcode_fields' ) ) {
[10723] Fix | Delete
// Backwards compatibility
[10724] Fix | Delete
return $this->__call( 'get_shortcode_fields', array() );
[10725] Fix | Delete
}
[10726] Fix | Delete
[10727] Fix | Delete
// Get module's default props from static property If current module's default props
[10728] Fix | Delete
// have been generated before.
[10729] Fix | Delete
if ( isset( self::$_default_props[ $this->slug ] ) ) {
[10730] Fix | Delete
return self::$_default_props[ $this->slug ];
[10731] Fix | Delete
}
[10732] Fix | Delete
[10733] Fix | Delete
$fields = array();
[10734] Fix | Delete
[10735] Fix | Delete
// Resolve option template
[10736] Fix | Delete
foreach( $this->process_fields( $this->fields_unprocessed ) as $field_name => $field ) {
[10737] Fix | Delete
$value = '';
[10738] Fix | Delete
[10739] Fix | Delete
if ( isset( $field['composite_type'], $field['composite_structure'] ) ) {
[10740] Fix | Delete
require_once ET_BUILDER_DIR . 'module/field/attribute/composite/Parser.php';
[10741] Fix | Delete
$composite_atts = ET_Builder_Module_Field_Attribute_Composite_Parser::parse( $field['composite_type'], $field['composite_structure'] );
[10742] Fix | Delete
$fields = array_merge( $fields, $composite_atts );
[10743] Fix | Delete
} else {
[10744] Fix | Delete
if ( isset( $field['default_on_front'] ) ) {
[10745] Fix | Delete
$value = $field['default_on_front'];
[10746] Fix | Delete
} else if ( isset( $field['default'] ) ) {
[10747] Fix | Delete
$value = $field['default'];
[10748] Fix | Delete
}
[10749] Fix | Delete
[10750] Fix | Delete
$fields[ $field_name ] = $value;
[10751] Fix | Delete
}
[10752] Fix | Delete
}
[10753] Fix | Delete
[10754] Fix | Delete
$fields['disabled'] = 'off';
[10755] Fix | Delete
$fields['disabled_on'] = '';
[10756] Fix | Delete
$fields['global_module'] = '';
[10757] Fix | Delete
$fields['temp_global_module'] = '';
[10758] Fix | Delete
$fields['global_parent'] = '';
[10759] Fix | Delete
$fields['temp_global_parent'] = '';
[10760] Fix | Delete
$fields['saved_tabs'] = '';
[10761] Fix | Delete
$fields['ab_subject'] = '';
[10762] Fix | Delete
$fields['ab_subject_id'] = '';
[10763] Fix | Delete
$fields['ab_goal'] = '';
[10764] Fix | Delete
$fields['locked'] = '';
[10765] Fix | Delete
$fields['template_type'] = '';
[10766] Fix | Delete
$fields['inline_fonts'] = '';
[10767] Fix | Delete
$fields['collapsed'] = '';
[10768] Fix | Delete
[10769] Fix | Delete
// Default props of each modules are always identical; thus saves it as static prop
[10770] Fix | Delete
// so the next same modules doesn't need to process all of these again repetitively.
[10771] Fix | Delete
self::$_default_props[ $this->slug ] = $fields;
[10772] Fix | Delete
[10773] Fix | Delete
return $fields;
[10774] Fix | Delete
}
[10775] Fix | Delete
[10776] Fix | Delete
function get_module_data_attributes() {
[10777] Fix | Delete
$attributes = apply_filters(
[10778] Fix | Delete
"{$this->slug}_data_attributes",
[10779] Fix | Delete
array(),
[10780] Fix | Delete
$this->props,
[10781] Fix | Delete
$this->render_count()
[10782] Fix | Delete
);
[10783] Fix | Delete
[10784] Fix | Delete
$data_attributes = '';
[10785] Fix | Delete
[10786] Fix | Delete
if ( ! empty( $attributes ) ) {
[10787] Fix | Delete
foreach ( $attributes as $name => $value ) {
[10788] Fix | Delete
$data_attributes .= sprintf(
[10789] Fix | Delete
' data-%1$s="%2$s"',
[10790] Fix | Delete
sanitize_title( $name ),
[10791] Fix | Delete
esc_attr( $value )
[10792] Fix | Delete
);
[10793] Fix | Delete
}
[10794] Fix | Delete
}
[10795] Fix | Delete
[10796] Fix | Delete
return $data_attributes;
[10797] Fix | Delete
}
[10798] Fix | Delete
[10799] Fix | Delete
function build_microtemplate() {
[10800] Fix | Delete
$this->validation_in_use = false;
[10801] Fix | Delete
$template_output = '';
[10802] Fix | Delete
[10803] Fix | Delete
if ( 'child' === $this->type ) {
[10804] Fix | Delete
$id_attr = sprintf( 'et-builder-advanced-setting-%s', $this->slug );
[10805] Fix | Delete
} else {
[10806] Fix | Delete
$id_attr = sprintf( 'et-builder-%s-module-template', $this->slug );
[10807] Fix | Delete
}
[10808] Fix | Delete
[10809] Fix | Delete
if ( ! isset( $this->settings_text ) ) {
[10810] Fix | Delete
$settings_text = sprintf(
[10811] Fix | Delete
__( '%1$s %2$s Settings', 'et_builder' ),
[10812] Fix | Delete
esc_html( $this->name ),
[10813] Fix | Delete
'child' === $this->type ? esc_html__( 'Item', 'et_builder' ) : esc_html__( 'Module', 'et_builder' )
[10814] Fix | Delete
);
[10815] Fix | Delete
} else {
[10816] Fix | Delete
$settings_text = $this->settings_text;
[10817] Fix | Delete
}
[10818] Fix | Delete
[10819] Fix | Delete
if ( file_exists( ET_BUILDER_DIR . 'microtemplates/' . $this->slug . '.php' ) ) {
[10820] Fix | Delete
ob_start();
[10821] Fix | Delete
include ET_BUILDER_DIR . 'microtemplates/' . $this->slug . '.php';
[10822] Fix | Delete
$output = ob_get_clean();
[10823] Fix | Delete
} else {
[10824] Fix | Delete
$output = $this->get_options();
[10825] Fix | Delete
}
[10826] Fix | Delete
[10827] Fix | Delete
$output = $this->wrap_settings( $output );
[10828] Fix | Delete
if ( $this->validation_in_use ) {
[10829] Fix | Delete
$output = $this->wrap_validation_form( $output );
[10830] Fix | Delete
}
[10831] Fix | Delete
[10832] Fix | Delete
$template_output = sprintf(
[10833] Fix | Delete
'<script type="text/template" id="%1$s">
[10834] Fix | Delete
<h3 class="et-pb-settings-heading">%2$s</h3>
[10835] Fix | Delete
%3$s
[10836] Fix | Delete
</script>',
[10837] Fix | Delete
esc_attr( $id_attr ),
[10838] Fix | Delete
esc_html( $settings_text ),
[10839] Fix | Delete
et_core_intentionally_unescaped( $output, 'html' )
[10840] Fix | Delete
);
[10841] Fix | Delete
[10842] Fix | Delete
if ( 'child' === $this->type ) {
[10843] Fix | Delete
$title_var = esc_js( $this->child_title_var );
[10844] Fix | Delete
$title_var = false === strpos( $title_var, 'et_pb_' ) && 'admin_label' !== $title_var ? 'et_pb_' . $title_var : $title_var;
[10845] Fix | Delete
$title_fallback_var = esc_js( $this->child_title_fallback_var );
[10846] Fix | Delete
$title_fallback_var = false === strpos( $title_fallback_var, 'et_pb_' ) ? 'et_pb_'. $title_fallback_var : $title_fallback_var;
[10847] Fix | Delete
$add_new_text = isset( $this->advanced_setting_title_text ) ? $this->advanced_setting_title_text : $this->add_new_child_text();
[10848] Fix | Delete
[10849] Fix | Delete
$template_output .= sprintf(
[10850] Fix | Delete
'%6$s<script type="text/template" id="et-builder-advanced-setting-%1$s-title">
[10851] Fix | Delete
<%% if ( typeof( %2$s ) !== \'undefined\' && typeof( %2$s ) === \'string\' && %2$s !== \'\' ) { %%>
[10852] Fix | Delete
<%% if ( ET_PageBuilder.isDynamicContent(%2$s) ) { %%>
[10853] Fix | Delete
%7$s
[10854] Fix | Delete
<%% } else { %%>
[10855] Fix | Delete
<%%- %2$s.replace( /%%91/g, "[" ).replace( /%%93/g, "]" ) %%>
[10856] Fix | Delete
<%% } %%>
[10857] Fix | Delete
<%% } else if ( typeof( %3$s ) !== \'undefined\' && typeof( %3$s ) === \'string\' && %3$s !== \'\' ) { %%>
[10858] Fix | Delete
<%% if ( ET_PageBuilder.isDynamicContent(%3$s) ) { %%>
[10859] Fix | Delete
%7$s
[10860] Fix | Delete
<%% } else { %%>
[10861] Fix | Delete
<%%- %3$s.replace( /%%91/g, "[" ).replace( /%%93/g, "]" ) %%>
[10862] Fix | Delete
<%% } %%>
[10863] Fix | Delete
<%% } else { %%>
[10864] Fix | Delete
<%%- \'%4$s\' %%>
[10865] Fix | Delete
<%% } %%>
[10866] Fix | Delete
</script>%5$s',
[10867] Fix | Delete
esc_attr( $this->slug ),
[10868] Fix | Delete
esc_html( $title_var ),
[10869] Fix | Delete
esc_html( $title_fallback_var ),
[10870] Fix | Delete
esc_html( $add_new_text ),
[10871] Fix | Delete
"\n\n",
[10872] Fix | Delete
"\t",
[10873] Fix | Delete
$this->get_icon( 'lock' ) . esc_html__( 'Dynamic Content', 'et_builder' )
[10874] Fix | Delete
);
[10875] Fix | Delete
}
[10876] Fix | Delete
[10877] Fix | Delete
return $template_output;
[10878] Fix | Delete
}
[10879] Fix | Delete
[10880] Fix | Delete
function get_gradient( $args ) {
[10881] Fix | Delete
$defaults = apply_filters( 'et_pb_default_gradient', array(
[10882] Fix | Delete
'type' => ET_Global_Settings::get_value( 'all_background_gradient_type' ),
[10883] Fix | Delete
'direction' => ET_Global_Settings::get_value( 'all_background_gradient_direction' ),
[10884] Fix | Delete
'radial_direction' => ET_Global_Settings::get_value( 'all_background_gradient_direction_radial' ),
[10885] Fix | Delete
'color_start' => ET_Global_Settings::get_value( 'all_background_gradient_start' ),
[10886] Fix | Delete
'color_end' => ET_Global_Settings::get_value( 'all_background_gradient_end' ),
[10887] Fix | Delete
'start_position' => ET_Global_Settings::get_value( 'all_background_gradient_start_position' ),
[10888] Fix | Delete
'end_position' => ET_Global_Settings::get_value( 'all_background_gradient_end_position' ),
[10889] Fix | Delete
) );
[10890] Fix | Delete
[10891] Fix | Delete
$args = wp_parse_args( array_filter( $args ), $defaults );
[10892] Fix | Delete
$direction = $args['type'] === 'linear' ? $args['direction'] : "circle at {$args['radial_direction']}";
[10893] Fix | Delete
$start_position = et_sanitize_input_unit( $args['start_position'], false, '%' );
[10894] Fix | Delete
$end_Position = et_sanitize_input_unit( $args['end_position'], false, '%');
[10895] Fix | Delete
[10896] Fix | Delete
return esc_html( "{$args['type']}-gradient(
[10897] Fix | Delete
{$direction},
[10898] Fix | Delete
{$args['color_start']} ${start_position},
[10899] Fix | Delete
{$args['color_end']} ${end_Position}
[10900] Fix | Delete
)" );
[10901] Fix | Delete
}
[10902] Fix | Delete
[10903] Fix | Delete
function get_rel_values() {
[10904] Fix | Delete
return array(
[10905] Fix | Delete
'bookmark',
[10906] Fix | Delete
'external',
[10907] Fix | Delete
'nofollow',
[10908] Fix | Delete
'noreferrer',
[10909] Fix | Delete
'noopener',
[10910] Fix | Delete
);
[10911] Fix | Delete
}
[10912] Fix | Delete
[10913] Fix | Delete
function get_rel_attributes( $saved_value, $add_tag = true ) {
[10914] Fix | Delete
$rel_attributes = array();
[10915] Fix | Delete
[10916] Fix | Delete
if ( $saved_value ) {
[10917] Fix | Delete
$rel_values = $this->get_rel_values();
[10918] Fix | Delete
$selected_rels = explode( '|', $saved_value );
[10919] Fix | Delete
[10920] Fix | Delete
foreach ( $selected_rels as $index => $selected_rel ) {
[10921] Fix | Delete
if ( ! $selected_rel || 'off' === $selected_rel ) {
[10922] Fix | Delete
continue;
[10923] Fix | Delete
}
[10924] Fix | Delete
[10925] Fix | Delete
$rel_attributes[] = $rel_values[ $index ];
[10926] Fix | Delete
}
[10927] Fix | Delete
}
[10928] Fix | Delete
[10929] Fix | Delete
$attr = empty( $rel_attributes ) ? '' : implode( ' ', $rel_attributes );
[10930] Fix | Delete
[10931] Fix | Delete
return ( $add_tag && '' !== $attr ) ? sprintf( ' rel="%1$s"', esc_attr( $attr ) ) : $attr;
[10932] Fix | Delete
}
[10933] Fix | Delete
[10934] Fix | Delete
/**
[10935] Fix | Delete
* Get text orientation.
[10936] Fix | Delete
*
[10937] Fix | Delete
* @since 3.23 Add device and desktop default parameter to get responsive value.
[10938] Fix | Delete
*
[10939] Fix | Delete
* @param string $device Device name.
[10940] Fix | Delete
* @param string $desktop_default Default desktop value.
[10941] Fix | Delete
* @return string RTL ready text alignment value.
[10942] Fix | Delete
*/
[10943] Fix | Delete
function get_text_orientation( $device = 'desktop', $desktop_default = '' ) {
[10944] Fix | Delete
$text_orientation = 'desktop' === $device && isset( $this->props['text_orientation'] ) ? $this->props['text_orientation'] : '';
[10945] Fix | Delete
if ( 'desktop' !== $device ) {
[10946] Fix | Delete
$text_orientation = et_pb_responsive_options()->get_any_value( $this->props, "text_orientation_{$device}", $desktop_default );
[10947] Fix | Delete
}
[10948] Fix | Delete
[10949] Fix | Delete
return et_pb_get_alignment( $text_orientation );
[10950] Fix | Delete
}
[10951] Fix | Delete
[10952] Fix | Delete
/**
[10953] Fix | Delete
* Get text orientation class.
[10954] Fix | Delete
*
[10955] Fix | Delete
* @since 3.23 Generate text orientation classes for tablet and phone.
[10956] Fix | Delete
*
[10957] Fix | Delete
* @return string Text orientation class names.
[10958] Fix | Delete
*/
[10959] Fix | Delete
function get_text_orientation_classname( $print_default = false ) {
[10960] Fix | Delete
$text_orientation = $this->get_text_orientation();
[10961] Fix | Delete
$text_orientation_tablet = $this->get_text_orientation( 'tablet' );
[10962] Fix | Delete
$text_orientation_phone = $this->get_text_orientation( 'phone' );
[10963] Fix | Delete
[10964] Fix | Delete
// Should be `justified` instead of justify in classname.
[10965] Fix | Delete
$text_orientation = 'justify' === $text_orientation ? 'justified' : $text_orientation;
[10966] Fix | Delete
$text_orientation_tablet = 'justify' === $text_orientation_tablet ? 'justified' : $text_orientation_tablet;
[10967] Fix | Delete
$text_orientation_phone = 'justify' === $text_orientation_phone ? 'justified' : $text_orientation_phone;
[10968] Fix | Delete
[10969] Fix | Delete
$default_classname = $print_default ? ' et_pb_text_align_left' : '';
[10970] Fix | Delete
[10971] Fix | Delete
$text_orientation_classname = '';
[10972] Fix | Delete
if ( '' !== $text_orientation ) {
[10973] Fix | Delete
$text_orientation_classname .= " et_pb_text_align_{$text_orientation}";
[10974] Fix | Delete
}
[10975] Fix | Delete
[10976] Fix | Delete
if ( '' !== $text_orientation_tablet ) {
[10977] Fix | Delete
$text_orientation_classname .= " et_pb_text_align_{$text_orientation_tablet}-tablet";
[10978] Fix | Delete
}
[10979] Fix | Delete
[10980] Fix | Delete
if ( '' !== $text_orientation_phone ) {
[10981] Fix | Delete
$text_orientation_classname .= " et_pb_text_align_{$text_orientation_phone}-phone";
[10982] Fix | Delete
}
[10983] Fix | Delete
[10984] Fix | Delete
return '' !== $text_orientation_classname ? $text_orientation_classname : $default_classname;
[10985] Fix | Delete
}
[10986] Fix | Delete
[10987] Fix | Delete
// intended to be overridden as needed
[10988] Fix | Delete
function get_max_width_additional_css() {
[10989] Fix | Delete
return '';
[10990] Fix | Delete
}
[10991] Fix | Delete
[10992] Fix | Delete
/**
[10993] Fix | Delete
* Get type of element
[10994] Fix | Delete
*/
[10995] Fix | Delete
public function get_type() {
[10996] Fix | Delete
return $this->type;
[10997] Fix | Delete
}
[10998] Fix | Delete
[10999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function