Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/includes/builder/module
File: Login.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Login extends ET_Builder_Module {
[2] Fix | Delete
function init() {
[3] Fix | Delete
$this->name = esc_html__( 'Login', 'et_builder' );
[4] Fix | Delete
$this->plural = esc_html__( 'Logins', 'et_builder' );
[5] Fix | Delete
$this->slug = 'et_pb_login';
[6] Fix | Delete
$this->vb_support = 'on';
[7] Fix | Delete
[8] Fix | Delete
$this->main_css_element = '%%order_class%%.et_pb_login';
[9] Fix | Delete
[10] Fix | Delete
$this->settings_modal_toggles = array(
[11] Fix | Delete
'general' => array(
[12] Fix | Delete
'toggles' => array(
[13] Fix | Delete
'main_content' => et_builder_i18n( 'Text' ),
[14] Fix | Delete
'redirect' => esc_html__( 'Redirect', 'et_builder' ),
[15] Fix | Delete
),
[16] Fix | Delete
),
[17] Fix | Delete
'advanced' => array(
[18] Fix | Delete
'toggles' => array(
[19] Fix | Delete
'text' => array(
[20] Fix | Delete
'title' => et_builder_i18n( 'Text' ),
[21] Fix | Delete
'priority' => 49,
[22] Fix | Delete
),
[23] Fix | Delete
),
[24] Fix | Delete
),
[25] Fix | Delete
);
[26] Fix | Delete
[27] Fix | Delete
$this->advanced_fields = array(
[28] Fix | Delete
'fonts' => array(
[29] Fix | Delete
'header' => array(
[30] Fix | Delete
'label' => et_builder_i18n( 'Title' ),
[31] Fix | Delete
'css' => array(
[32] Fix | Delete
'main' => "{$this->main_css_element} h2, {$this->main_css_element} h1.et_pb_module_header, {$this->main_css_element} h3.et_pb_module_header, {$this->main_css_element} h4.et_pb_module_header, {$this->main_css_element} h5.et_pb_module_header, {$this->main_css_element} h6.et_pb_module_header",
[33] Fix | Delete
'important' => 'all',
[34] Fix | Delete
),
[35] Fix | Delete
'header_level' => array(
[36] Fix | Delete
'default' => 'h2',
[37] Fix | Delete
),
[38] Fix | Delete
),
[39] Fix | Delete
'body' => array(
[40] Fix | Delete
'label' => et_builder_i18n( 'Body' ),
[41] Fix | Delete
'css' => array(
[42] Fix | Delete
'line_height' => "{$this->main_css_element} p",
[43] Fix | Delete
'font' => "{$this->main_css_element}, {$this->main_css_element} .et_pb_newsletter_description_content, {$this->main_css_element} p, {$this->main_css_element} span",
[44] Fix | Delete
'text_shadow' => "{$this->main_css_element}, {$this->main_css_element} .et_pb_newsletter_description_content, {$this->main_css_element} p, {$this->main_css_element} span",
[45] Fix | Delete
),
[46] Fix | Delete
'block_elements' => array(
[47] Fix | Delete
'tabbed_subtoggles' => true,
[48] Fix | Delete
'bb_icons_support' => true,
[49] Fix | Delete
'css' => array(
[50] Fix | Delete
'main' => "{$this->main_css_element}",
[51] Fix | Delete
),
[52] Fix | Delete
),
[53] Fix | Delete
),
[54] Fix | Delete
),
[55] Fix | Delete
'margin_padding' => array(
[56] Fix | Delete
'css' => array(
[57] Fix | Delete
'important' => 'all',
[58] Fix | Delete
),
[59] Fix | Delete
),
[60] Fix | Delete
'button' => array(
[61] Fix | Delete
'button' => array(
[62] Fix | Delete
'label' => et_builder_i18n( 'Button' ),
[63] Fix | Delete
'css' => array(
[64] Fix | Delete
'main' => "{$this->main_css_element} .et_pb_newsletter_button.et_pb_button",
[65] Fix | Delete
'limited_main' => "{$this->main_css_element} .et_pb_newsletter_button.et_pb_button",
[66] Fix | Delete
),
[67] Fix | Delete
'no_rel_attr' => true,
[68] Fix | Delete
'box_shadow' => array(
[69] Fix | Delete
'css' => array(
[70] Fix | Delete
'main' => '%%order_class%% .et_pb_button',
[71] Fix | Delete
),
[72] Fix | Delete
),
[73] Fix | Delete
'margin_padding' => array(
[74] Fix | Delete
'css' => array(
[75] Fix | Delete
'important' => 'all',
[76] Fix | Delete
),
[77] Fix | Delete
),
[78] Fix | Delete
),
[79] Fix | Delete
),
[80] Fix | Delete
'background' => array(
[81] Fix | Delete
'has_background_color_toggle' => true,
[82] Fix | Delete
'use_background_color' => true,
[83] Fix | Delete
'options' => array(
[84] Fix | Delete
'background_color' => array(
[85] Fix | Delete
'depends_show_if' => 'on',
[86] Fix | Delete
'default' => et_builder_accent_color(),
[87] Fix | Delete
),
[88] Fix | Delete
'use_background_color' => array(
[89] Fix | Delete
'default' => 'on',
[90] Fix | Delete
),
[91] Fix | Delete
),
[92] Fix | Delete
),
[93] Fix | Delete
'text' => array(
[94] Fix | Delete
'use_background_layout' => true,
[95] Fix | Delete
'options' => array(
[96] Fix | Delete
'text_orientation' => array(
[97] Fix | Delete
'default' => 'left',
[98] Fix | Delete
),
[99] Fix | Delete
'background_layout' => array(
[100] Fix | Delete
'default' => 'dark',
[101] Fix | Delete
'hover' => 'tabs',
[102] Fix | Delete
),
[103] Fix | Delete
),
[104] Fix | Delete
'css' => array(
[105] Fix | Delete
'main' => implode(
[106] Fix | Delete
', ',
[107] Fix | Delete
array(
[108] Fix | Delete
'%%order_class%% .et_pb_module_header',
[109] Fix | Delete
'%%order_class%% .et_pb_newsletter_description_content',
[110] Fix | Delete
'%%order_class%% .et_pb_forgot_password a',
[111] Fix | Delete
)
[112] Fix | Delete
),
[113] Fix | Delete
),
[114] Fix | Delete
),
[115] Fix | Delete
'form_field' => array(
[116] Fix | Delete
'form_field' => array(
[117] Fix | Delete
'label' => esc_html__( 'Fields', 'et_builder' ),
[118] Fix | Delete
'css' => array(
[119] Fix | Delete
'main' => '%%order_class%% input[type="password"], %%order_class%% input[type="text"], %%order_class%% textarea, %%order_class%% .input',
[120] Fix | Delete
'hover' => '%%order_class%% input[type="text"]:hover, %%order_class%% textarea:hover, %%order_class%% .input:hover',
[121] Fix | Delete
'focus' => '%%order_class%% .et_pb_newsletter_form p input:focus',
[122] Fix | Delete
'focus_hover' => '%%order_class%% .et_pb_newsletter_form p input:focus:hover',
[123] Fix | Delete
'placeholder_focus' => '%%order_class%% .et_pb_newsletter_form p input:focus::-webkit-input-placeholder, %%order_class%% .et_pb_newsletter_form p input:focus::-moz-placeholder, %%order_class%% .et_pb_newsletter_form p input:focus:-ms-input-placeholder',
[124] Fix | Delete
'padding' => '%%order_class%% .et_pb_newsletter_form .input',
[125] Fix | Delete
'margin' => '%%order_class%% .et_pb_newsletter_form .et_pb_contact_form_field',
[126] Fix | Delete
'important' => array( 'padding', 'margin' ),
[127] Fix | Delete
),
[128] Fix | Delete
'box_shadow' => array(
[129] Fix | Delete
'name' => 'fields',
[130] Fix | Delete
'css' => array(
[131] Fix | Delete
'main' => '%%order_class%% .et_pb_newsletter_form .input',
[132] Fix | Delete
),
[133] Fix | Delete
),
[134] Fix | Delete
'border_styles' => array(
[135] Fix | Delete
'form_field' => array(
[136] Fix | Delete
'name' => 'fields',
[137] Fix | Delete
'css' => array(
[138] Fix | Delete
'main' => array(
[139] Fix | Delete
'border_radii' => '%%order_class%% .et_pb_newsletter_form p input',
[140] Fix | Delete
'border_styles' => '%%order_class%% .et_pb_newsletter_form p input',
[141] Fix | Delete
),
[142] Fix | Delete
),
[143] Fix | Delete
'label_prefix' => esc_html__( 'Fields', 'et_builder' ),
[144] Fix | Delete
),
[145] Fix | Delete
'form_field_focus' => array(
[146] Fix | Delete
'name' => 'fields_focus',
[147] Fix | Delete
'css' => array(
[148] Fix | Delete
'main' => array(
[149] Fix | Delete
'border_radii' => '%%order_class%% .et_pb_newsletter_form p input:focus',
[150] Fix | Delete
'border_styles' => '%%order_class%% .et_pb_newsletter_form p input:focus',
[151] Fix | Delete
),
[152] Fix | Delete
),
[153] Fix | Delete
'label_prefix' => esc_html__( 'Fields Focus', 'et_builder' ),
[154] Fix | Delete
),
[155] Fix | Delete
),
[156] Fix | Delete
'font_field' => array(
[157] Fix | Delete
'css' => array(
[158] Fix | Delete
'main' => '%%order_class%% .et_pb_newsletter_form .input',
[159] Fix | Delete
'hover' => '%%order_class%% .et_pb_newsletter_form .input:hover',
[160] Fix | Delete
'text_shadow' => "{$this->main_css_element} input",
[161] Fix | Delete
'important' => 'plugin_only',
[162] Fix | Delete
),
[163] Fix | Delete
),
[164] Fix | Delete
),
[165] Fix | Delete
),
[166] Fix | Delete
);
[167] Fix | Delete
[168] Fix | Delete
$this->custom_css_fields = array(
[169] Fix | Delete
'newsletter_title' => array(
[170] Fix | Delete
'label' => esc_html__( 'Login Title', 'et_builder' ),
[171] Fix | Delete
'selector' => "{$this->main_css_element} h2, {$this->main_css_element} h1.et_pb_module_header, {$this->main_css_element} h3.et_pb_module_header, {$this->main_css_element} h4.et_pb_module_header, {$this->main_css_element} h5.et_pb_module_header, {$this->main_css_element} h6.et_pb_module_header",
[172] Fix | Delete
),
[173] Fix | Delete
'newsletter_description' => array(
[174] Fix | Delete
'label' => esc_html__( 'Login Description', 'et_builder' ),
[175] Fix | Delete
'selector' => '.et_pb_newsletter_description',
[176] Fix | Delete
),
[177] Fix | Delete
'newsletter_form' => array(
[178] Fix | Delete
'label' => esc_html__( 'Login Form', 'et_builder' ),
[179] Fix | Delete
'selector' => '.et_pb_newsletter_form',
[180] Fix | Delete
),
[181] Fix | Delete
'newsletter_fields' => array(
[182] Fix | Delete
'label' => esc_html__( 'Login Fields', 'et_builder' ),
[183] Fix | Delete
'selector' => '.et_pb_newsletter_form input',
[184] Fix | Delete
),
[185] Fix | Delete
'newsletter_button' => array(
[186] Fix | Delete
'label' => esc_html__( 'Login Button', 'et_builder' ),
[187] Fix | Delete
'selector' => '.et_pb_login .et_pb_login_form .et_pb_newsletter_button.et_pb_button',
[188] Fix | Delete
'no_space_before_selector' => true,
[189] Fix | Delete
),
[190] Fix | Delete
);
[191] Fix | Delete
[192] Fix | Delete
$this->help_videos = array(
[193] Fix | Delete
array(
[194] Fix | Delete
'id' => '6ZEw-Izfjg8',
[195] Fix | Delete
'name' => esc_html__( 'An introduction to the Login module', 'et_builder' ),
[196] Fix | Delete
),
[197] Fix | Delete
);
[198] Fix | Delete
}
[199] Fix | Delete
[200] Fix | Delete
function get_fields() {
[201] Fix | Delete
$fields = array(
[202] Fix | Delete
'title' => array(
[203] Fix | Delete
'label' => et_builder_i18n( 'Title' ),
[204] Fix | Delete
'type' => 'text',
[205] Fix | Delete
'option_category' => 'basic_option',
[206] Fix | Delete
'description' => esc_html__( 'Choose a title of your login box.', 'et_builder' ),
[207] Fix | Delete
'toggle_slug' => 'main_content',
[208] Fix | Delete
'dynamic_content' => 'text',
[209] Fix | Delete
'mobile_options' => true,
[210] Fix | Delete
'hover' => 'tabs',
[211] Fix | Delete
),
[212] Fix | Delete
'current_page_redirect' => array(
[213] Fix | Delete
'label' => esc_html__( 'Redirect To The Current Page', 'et_builder' ),
[214] Fix | Delete
'type' => 'yes_no_button',
[215] Fix | Delete
'option_category' => 'configuration',
[216] Fix | Delete
'options' => array(
[217] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[218] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[219] Fix | Delete
),
[220] Fix | Delete
'default_on_front' => 'off',
[221] Fix | Delete
'toggle_slug' => 'redirect',
[222] Fix | Delete
'description' => esc_html__( 'Here you can choose whether the user should be redirected back to the current page after logging in.', 'et_builder' ),
[223] Fix | Delete
),
[224] Fix | Delete
'content' => array(
[225] Fix | Delete
'label' => et_builder_i18n( 'Body' ),
[226] Fix | Delete
'type' => 'tiny_mce',
[227] Fix | Delete
'option_category' => 'basic_option',
[228] Fix | Delete
'description' => esc_html__( 'Input the main text content for your module here.', 'et_builder' ),
[229] Fix | Delete
'toggle_slug' => 'main_content',
[230] Fix | Delete
'dynamic_content' => 'text',
[231] Fix | Delete
'mobile_options' => true,
[232] Fix | Delete
'hover' => 'tabs',
[233] Fix | Delete
),
[234] Fix | Delete
);
[235] Fix | Delete
[236] Fix | Delete
return $fields;
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
public function get_transition_fields_css_props() {
[240] Fix | Delete
return parent::get_transition_fields_css_props();
[241] Fix | Delete
}
[242] Fix | Delete
[243] Fix | Delete
/**
[244] Fix | Delete
* Renders the module output.
[245] Fix | Delete
*
[246] Fix | Delete
* @param array $attrs List of attributes.
[247] Fix | Delete
* @param string $content Content being processed.
[248] Fix | Delete
* @param string $render_slug Slug of module that is used for rendering output.
[249] Fix | Delete
*
[250] Fix | Delete
* @return string
[251] Fix | Delete
*/
[252] Fix | Delete
public function render( $attrs, $content, $render_slug ) {
[253] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[254] Fix | Delete
$module_id = $this->props['module_id'];
[255] Fix | Delete
$title = $multi_view->render_element(
[256] Fix | Delete
array(
[257] Fix | Delete
'tag' => et_pb_process_header_level( $this->props['header_level'], 'h2' ),
[258] Fix | Delete
'content' => '{{title}}',
[259] Fix | Delete
'attrs' => array(
[260] Fix | Delete
'class' => 'et_pb_module_header',
[261] Fix | Delete
),
[262] Fix | Delete
)
[263] Fix | Delete
);
[264] Fix | Delete
$background_color = $this->props['background_color'];
[265] Fix | Delete
$use_background_color = $this->props['use_background_color'];
[266] Fix | Delete
$current_page_redirect = $this->props['current_page_redirect'];
[267] Fix | Delete
$button_custom = $this->props['custom_button'];
[268] Fix | Delete
$header_level = $this->props['header_level'];
[269] Fix | Delete
$content = $this->content;
[270] Fix | Delete
$use_focus_border_color = $this->props['use_focus_border_color'];
[271] Fix | Delete
[272] Fix | Delete
$custom_icon_values = et_pb_responsive_options()->get_property_values( $this->props, 'button_icon' );
[273] Fix | Delete
$custom_icon = isset( $custom_icon_values['desktop'] ) ? $custom_icon_values['desktop'] : '';
[274] Fix | Delete
$custom_icon_tablet = isset( $custom_icon_values['tablet'] ) ? $custom_icon_values['tablet'] : '';
[275] Fix | Delete
$custom_icon_phone = isset( $custom_icon_values['phone'] ) ? $custom_icon_values['phone'] : '';
[276] Fix | Delete
[277] Fix | Delete
$redirect_url = 'on' === $current_page_redirect
[278] Fix | Delete
? ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']
[279] Fix | Delete
: '';
[280] Fix | Delete
[281] Fix | Delete
if ( is_user_logged_in() && ! is_customize_preview() && ! is_et_pb_preview() ) {
[282] Fix | Delete
$current_user = wp_get_current_user();
[283] Fix | Delete
[284] Fix | Delete
$content .= sprintf(
[285] Fix | Delete
'<br/>%1$s <a href="%2$s">%3$s</a>',
[286] Fix | Delete
sprintf( esc_html__( 'Logged in as %1$s', 'et_builder' ), esc_html( $current_user->display_name ) ),
[287] Fix | Delete
esc_url( wp_logout_url( $redirect_url ) ),
[288] Fix | Delete
esc_html__( 'Log out', 'et_builder' )
[289] Fix | Delete
);
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
$video_background = $this->video_background();
[293] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[294] Fix | Delete
[295] Fix | Delete
$form = '';
[296] Fix | Delete
[297] Fix | Delete
if ( ! is_user_logged_in() || is_customize_preview() || is_et_pb_preview() ) {
[298] Fix | Delete
$username = esc_html__( 'Username', 'et_builder' );
[299] Fix | Delete
$password = esc_html__( 'Password', 'et_builder' );
[300] Fix | Delete
[301] Fix | Delete
$form = sprintf(
[302] Fix | Delete
'
[303] Fix | Delete
<div class="et_pb_newsletter_form et_pb_login_form">
[304] Fix | Delete
<form action="%7$s" method="post">
[305] Fix | Delete
<p class="et_pb_contact_form_field">
[306] Fix | Delete
<label class="et_pb_contact_form_label" for="user_login_%12$s" style="display: none;">%3$s</label>
[307] Fix | Delete
<input id="user_login_%12$s" placeholder="%4$s" class="input" type="text" value="" name="log" />
[308] Fix | Delete
</p>
[309] Fix | Delete
<p class="et_pb_contact_form_field">
[310] Fix | Delete
<label class="et_pb_contact_form_label" for="user_pass_%12$s" style="display: none;">%5$s</label>
[311] Fix | Delete
<input id="user_pass_%12$s" placeholder="%6$s" class="input" type="password" value="" name="pwd" />
[312] Fix | Delete
</p>
[313] Fix | Delete
<p class="et_pb_forgot_password"><a href="%2$s">%1$s</a></p>
[314] Fix | Delete
<p>
[315] Fix | Delete
<button type="submit" name="et_builder_submit_button" class="et_pb_newsletter_button et_pb_button%11$s"%10$s%13$s%14$s>%8$s</button>
[316] Fix | Delete
%9$s
[317] Fix | Delete
</p>
[318] Fix | Delete
</form>
[319] Fix | Delete
</div>',
[320] Fix | Delete
esc_html__( 'Forgot your password?', 'et_builder' ),
[321] Fix | Delete
esc_url( wp_lostpassword_url() ),
[322] Fix | Delete
esc_html( $username ),
[323] Fix | Delete
esc_attr( $username ),
[324] Fix | Delete
esc_html( $password ), // #5
[325] Fix | Delete
esc_attr( $password ),
[326] Fix | Delete
esc_url( site_url( 'wp-login.php', 'login_post' ) ),
[327] Fix | Delete
esc_html__( 'Login', 'et_builder' ),
[328] Fix | Delete
( 'on' === $current_page_redirect
[329] Fix | Delete
? sprintf( '<input type="hidden" name="redirect_to" value="%1$s" />', esc_url( $redirect_url ) )
[330] Fix | Delete
: ''
[331] Fix | Delete
),
[332] Fix | Delete
'' !== $custom_icon && 'on' === $button_custom ? sprintf(
[333] Fix | Delete
' data-icon="%1$s"',
[334] Fix | Delete
esc_attr( et_pb_process_font_icon( $custom_icon ) )
[335] Fix | Delete
) : '', // #10
[336] Fix | Delete
( '' !== $custom_icon || '' !== $custom_icon_tablet || '' !== $custom_icon_phone ) && 'on' === $button_custom ? ' et_pb_custom_button_icon' : '',
[337] Fix | Delete
// Prevent an accidental "duplicate ID" error if there's more than one instance of this module
[338] Fix | Delete
( '' !== $module_id ? esc_attr( $module_id ) : uniqid() ),
[339] Fix | Delete
'' !== $custom_icon_tablet && 'on' === $button_custom ? sprintf( ' data-icon-tablet="%1$s"', esc_attr( et_pb_process_font_icon( $custom_icon_tablet ) ) ) : '',
[340] Fix | Delete
'' !== $custom_icon_phone && 'on' === $button_custom ? sprintf( ' data-icon-phone="%1$s"', esc_attr( et_pb_process_font_icon( $custom_icon_phone ) ) ) : ''
[341] Fix | Delete
);
[342] Fix | Delete
}
[343] Fix | Delete
[344] Fix | Delete
// Background layout data attributes.
[345] Fix | Delete
$data_background_layout = et_pb_background_layout_options()->get_background_layout_attrs( $this->props );
[346] Fix | Delete
[347] Fix | Delete
// Module classnames
[348] Fix | Delete
$this->add_classname(
[349] Fix | Delete
array(
[350] Fix | Delete
'et_pb_newsletter',
[351] Fix | Delete
'clearfix',
[352] Fix | Delete
$this->get_text_orientation_classname(),
[353] Fix | Delete
)
[354] Fix | Delete
);
[355] Fix | Delete
[356] Fix | Delete
// Background layout class names.
[357] Fix | Delete
$background_layout_class_names = et_pb_background_layout_options()->get_background_layout_class( $this->props );
[358] Fix | Delete
$this->add_classname( $background_layout_class_names );
[359] Fix | Delete
[360] Fix | Delete
if ( is_customize_preview() || is_et_pb_preview() ) {
[361] Fix | Delete
$this->add_classname( 'et_pb_in_customizer' );
[362] Fix | Delete
}
[363] Fix | Delete
[364] Fix | Delete
if ( 'on' === $use_focus_border_color ) {
[365] Fix | Delete
$this->add_classname( 'et_pb_with_focus_border' );
[366] Fix | Delete
}
[367] Fix | Delete
[368] Fix | Delete
if ( ! $multi_view->has_value( 'title' ) ) {
[369] Fix | Delete
$this->add_classname( 'et_pb_newsletter_description_no_title' );
[370] Fix | Delete
}
[371] Fix | Delete
[372] Fix | Delete
if ( ! $multi_view->has_value( 'content' ) ) {
[373] Fix | Delete
$this->add_classname( 'et_pb_newsletter_description_no_content' );
[374] Fix | Delete
}
[375] Fix | Delete
[376] Fix | Delete
$content = $multi_view->render_element(
[377] Fix | Delete
array(
[378] Fix | Delete
'tag' => 'div',
[379] Fix | Delete
'content' => '{{content}}',
[380] Fix | Delete
'required' => false,
[381] Fix | Delete
'attrs' => array(
[382] Fix | Delete
'class' => 'et_pb_newsletter_description_content',
[383] Fix | Delete
),
[384] Fix | Delete
)
[385] Fix | Delete
);
[386] Fix | Delete
[387] Fix | Delete
$content_wrapper = $multi_view->render_element(
[388] Fix | Delete
array(
[389] Fix | Delete
'tag' => 'div',
[390] Fix | Delete
'content' => "{$title}{$content}",
[391] Fix | Delete
'attrs' => array(
[392] Fix | Delete
'class' => 'et_pb_newsletter_description',
[393] Fix | Delete
),
[394] Fix | Delete
'classes' => array(
[395] Fix | Delete
'et_multi_view_hidden' => array(
[396] Fix | Delete
'title' => '__empty',
[397] Fix | Delete
'content' => '__empty',
[398] Fix | Delete
),
[399] Fix | Delete
),
[400] Fix | Delete
)
[401] Fix | Delete
);
[402] Fix | Delete
[403] Fix | Delete
$wrapper_multi_view_classes = $multi_view->render_attrs(
[404] Fix | Delete
array(
[405] Fix | Delete
'classes' => array(
[406] Fix | Delete
'et_pb_newsletter_description_no_title' => array(
[407] Fix | Delete
'title' => '__empty',
[408] Fix | Delete
),
[409] Fix | Delete
'et_pb_newsletter_description_no_content' => array(
[410] Fix | Delete
'content' => '__empty',
[411] Fix | Delete
),
[412] Fix | Delete
),
[413] Fix | Delete
)
[414] Fix | Delete
);
[415] Fix | Delete
[416] Fix | Delete
$output = sprintf(
[417] Fix | Delete
'<div%4$s class="%2$s"%7$s%7$s>
[418] Fix | Delete
%6$s
[419] Fix | Delete
%5$s
[420] Fix | Delete
%3$s
[421] Fix | Delete
%1$s
[422] Fix | Delete
</div>',
[423] Fix | Delete
$form,
[424] Fix | Delete
$this->module_classname( $render_slug ),
[425] Fix | Delete
et_core_esc_previously( $content_wrapper ),
[426] Fix | Delete
$this->module_id(),
[427] Fix | Delete
$video_background, // #5
[428] Fix | Delete
$parallax_image_background,
[429] Fix | Delete
et_core_esc_previously( $data_background_layout ),
[430] Fix | Delete
$wrapper_multi_view_classes
[431] Fix | Delete
);
[432] Fix | Delete
[433] Fix | Delete
return $output;
[434] Fix | Delete
}
[435] Fix | Delete
[436] Fix | Delete
/**
[437] Fix | Delete
* Filter multi view value.
[438] Fix | Delete
*
[439] Fix | Delete
* @since 3.27.1
[440] Fix | Delete
*
[441] Fix | Delete
* @see ET_Builder_Module_Helper_MultiViewOptions::filter_value
[442] Fix | Delete
*
[443] Fix | Delete
* @param mixed $raw_value Props raw value.
[444] Fix | Delete
* @param array $args {
[445] Fix | Delete
* Context data.
[446] Fix | Delete
*
[447] Fix | Delete
* @type string $context Context param: content, attrs, visibility, classes.
[448] Fix | Delete
* @type string $name Module options props name.
[449] Fix | Delete
* @type string $mode Current data mode: desktop, hover, tablet, phone.
[450] Fix | Delete
* @type string $attr_key Attribute key for attrs context data. Example: src, class, etc.
[451] Fix | Delete
* @type string $attr_sub_key Attribute sub key that availabe when passing attrs value as array such as styes. Example: padding-top, margin-botton, etc.
[452] Fix | Delete
* }
[453] Fix | Delete
* @param ET_Builder_Module_Helper_MultiViewOptions $multi_view Multiview object instance.
[454] Fix | Delete
*
[455] Fix | Delete
* @return mixed
[456] Fix | Delete
*/
[457] Fix | Delete
public function multi_view_filter_value( $raw_value, $args, $multi_view ) {
[458] Fix | Delete
$name = isset( $args['name'] ) ? $args['name'] : '';
[459] Fix | Delete
$mode = isset( $args['mode'] ) ? $args['mode'] : '';
[460] Fix | Delete
[461] Fix | Delete
if ( is_user_logged_in() && ! is_customize_preview() && ! is_et_pb_preview() && 'content' === $name ) {
[462] Fix | Delete
$current_user = wp_get_current_user();
[463] Fix | Delete
$redirect_url = 'on' === $this->props['current_page_redirect']
[464] Fix | Delete
? ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']
[465] Fix | Delete
: '';
[466] Fix | Delete
[467] Fix | Delete
$raw_value .= sprintf(
[468] Fix | Delete
'%4$s%1$s <a href="%2$s">%3$s</a>',
[469] Fix | Delete
sprintf( esc_html__( 'Logged in as %1$s', 'et_builder' ), esc_html( $current_user->display_name ) ),
[470] Fix | Delete
esc_url( wp_logout_url( esc_url( $redirect_url ) ) ),
[471] Fix | Delete
esc_html__( 'Log out', 'et_builder' ),
[472] Fix | Delete
'' === $raw_value && ! $multi_view->has_value( 'title' ) ? '' : '<br/>'
[473] Fix | Delete
);
[474] Fix | Delete
}
[475] Fix | Delete
[476] Fix | Delete
$fields_need_escape = array(
[477] Fix | Delete
'title',
[478] Fix | Delete
);
[479] Fix | Delete
[480] Fix | Delete
if ( $raw_value && in_array( $name, $fields_need_escape, true ) ) {
[481] Fix | Delete
return $this->_esc_attr( $multi_view->get_name_by_mode( $name, $mode ), 'none', $raw_value );
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
return $raw_value;
[485] Fix | Delete
}
[486] Fix | Delete
}
[487] Fix | Delete
[488] Fix | Delete
new ET_Builder_Module_Login();
[489] Fix | Delete
[490] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function