: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<div class="et_pb_colorpalette_overview">
for ( $colorpalette_index = 1; $colorpalette_index <= $items_amount; $colorpalette_index++ ) { ?>
<span class="colorpalette-item colorpalette-item-<?php echo esc_attr( $colorpalette_index ); ?>" data-index="<?php echo esc_attr( $colorpalette_index ); ?>"><span class="color"></span></span>
<?php for ( $colorpicker_index = 1; $colorpicker_index <= $items_amount; $colorpicker_index++ ) { ?>
<div class="colorpalette-colorpicker" data-index="<?php echo esc_attr( $colorpicker_index ); ?>">
<input data-index="<?php echo esc_attr( $colorpicker_index ); ?>" type="text" class="input-colorpalette-colorpicker" data-alpha="true" />
<input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" class="et_color_palette_main_input" type="hidden" value="<?php echo esc_attr( $et_input_value ); ?>" />
</div> <!-- end et-box-content div -->
<span class="et-box-description"></span>
</div> <!-- end et-epanel-box div -->
<?php } elseif ( 'checkbox' === $value['type'] || 'checkbox2' === $value['type'] ) { ?>
$et_box_class = 'checkbox' === $value['type'] ? 'et-epanel-box-small-1' : 'et-epanel-box-small-2';
<div class="<?php echo esc_attr( 'et-epanel-box ' . $et_box_class . $hidden_option_classname ); ?>">
<div class="et-box-title"><h3><?php echo esc_html( $value['name'] ); ?></h3>
<div class="et-box-descr">
echo wp_kses( $value['desc'], array(
</div> <!-- end et-box-desc-content div -->
</div> <!-- end div et-box-title -->
<div class="et-box-content">
$value_id = et_get_option( $value['id'] );
if ( $is_new_global_setting && isset( $value['main_setting_name'] ) && isset( $value['sub_setting_name'] ) ) {
$saved_checkbox = et_get_option( $value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name );
$checked = ( 'on' === $saved_checkbox || (!$saved_checkbox && 'on' === $value['std']) ) ?
'checked="checked"' : '';
} else if ( ! empty( $value_id ) ) {
if ( 'on' === $value_id ) {
$checked = 'checked="checked"';
} else if ( 'on' === $value['std'] ) {
$checked = 'checked="checked"';
<?php if ( isset( $value['hidden_option_message'] ) && $is_hidden_option ) : ?>
<div class="et-hidden-option-message">
<?php echo et_core_esc_previously( wpautop( esc_html( $value['hidden_option_message'] ) ) ); ?>
<input type="checkbox" class="et-checkbox yes_no_button" name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] );?>" <?php echo et_core_esc_previously( $checked ); ?> <?php echo et_core_esc_previously( $disabled );?>/>
</div> <!-- end et-box-content div -->
<?php if ( 'et_pb_static_css_file' === $value['id'] ) { ?>
<span class="et-button"><?php echo esc_html_x( 'Clear', 'clear static resources', $themename ); ?></span>
<span class="et-box-description"></span>
</div> <!-- end epanel-box-small div -->
<?php } elseif ( 'checkbox_list' === $value['type'] ) { ?>
<div class="<?php echo esc_attr( 'et-epanel-box et-epanel-box__checkbox-list' . $hidden_option_classname ); ?>">
<div class="et-box-title">
<h3><?php echo esc_html( $value['name'] ); ?></h3>
<div class="et-box-descr">
echo wp_kses( $value['desc'], array(
</div> <!-- end et-box-descr div -->
</div> <!-- end div et-box-title -->
<div class="et-box-content et-epanel-box-small-2">
<div class="et-box-content--list">
if ( empty( $value['options'] ) ) {
esc_html_e( 'No available options.', $themename );
$defaults = ( isset( $value['default'] ) && is_array( $value['default'] ) ) ? $value['default'] : array();
$stored_values = et_get_option( $value['id'], array() );
$value_options = $value['options'];
if ( is_callable( $value_options ) ) {
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
$value_options = call_user_func( $value_options );
foreach ( $value_options as $option_key => $option ) {
$option_value = isset( $value['et_save_values'] ) && $value['et_save_values'] ? sanitize_text_field( $option_key ) : sanitize_text_field( $option );
$option_label = sanitize_text_field( $option );
$checked = isset( $defaults[ $option_value ] ) ? $defaults[ $option_value ] : 'off';
if ( isset( $stored_values[ $option_value ] ) ) {
$checked = $stored_values[ $option_value ];
$checked = 'on' === $checked ? 'checked="checked"' : '';
$checkbox_list_id = sanitize_text_field( $value['id'] . '-' . $option_key );
<div class="et-box-content">
<span class="et-panel-box__checkbox-list-label">
<?php echo esc_html( $option_label ); ?>
<input type="checkbox" class="et-checkbox yes_no_button" name="<?php echo esc_attr( $value['id'] ); ?>[]" id="<?php echo esc_attr( $checkbox_list_id ); ?>" value="<?php echo esc_attr( $option_value ); ?>" <?php echo et_core_esc_previously( $checked ); ?> />
</div> <!-- end et-box-content div -->
<span class="et-box-description"></span>
</div> <!-- end epanel-box-small div -->
<?php } elseif ( 'support' === $value['type'] ) { ?>
<div class="inner-content">
<?php include get_template_directory() . "/includes/functions/" . $value['name'] . ".php"; ?>
<?php } elseif ( 'contenttab-wrapstart' === $value['type'] || 'subcontent-start' === $value['type'] ) { ?>
<?php $et_contenttab_class = 'contenttab-wrapstart' === $value['type'] ? 'et-content-div' : 'et-tab-content'; ?>
<div id="<?php echo esc_attr( $value['name'] ); ?>" class="<?php echo esc_attr( $et_contenttab_class ); ?>">
<?php } elseif ( 'contenttab-wrapend' === $value['type'] || 'subcontent-end' === $value['type'] ) { ?>
</div> <!-- end <?php echo esc_html( $value['name'] ); ?> div -->
<?php } elseif ( 'subnavtab-start' === $value['type'] ) { ?>
<?php } elseif ( 'subnavtab-end' === $value['type'] ) { ?>
<?php } elseif ( 'subnav-tab' === $value['type'] ) { ?>
<li><a href="#<?php echo esc_attr( $value['name'] ); ?>"><span class="pngfix"><?php echo esc_html( $value['desc'] ); ?></span></a></li>
<?php } elseif ($value['type'] === "clearfix") { ?>
<div class="et-clearfix"></div>
<?php } //end foreach ($options as $value) ?>
</div> <!-- end epanel-content div -->
</div> <!-- end epanel-content-wrap div -->
</div> <!-- end epanel div -->
</div> <!-- end epanel-wrapper div -->
<?php wp_nonce_field( 'epanel_nonce' ); ?>
<button class="et-save-button" name="save" id="epanel-save"><?php esc_html_e( 'Save Changes', $themename ); ?></button>
<input type="hidden" name="action" value="save_epanel" />
</div><!-- end epanel-bottom div -->
<div class="reset-popup-overlay">
<div class="defaults-hover">
<div class="reset-popup-header"><?php esc_html_e( 'Reset', $themename ); ?></div>
<?php echo et_get_safe_localization( __( 'This will return all of the settings throughout the options page to their default values. <strong>Are you sure you want to do this?</strong>', $themename ) ); ?>
<div class="et-clearfix"></div>
<?php wp_nonce_field( 'et-nojs-reset_epanel', '_wpnonce_reset' ); ?>
<input name="reset" type="submit" value="<?php esc_attr_e( 'Yes', $themename ); ?>" id="epanel-reset" />
<input type="hidden" name="action" value="reset" />
<span class="no"><?php esc_html_e( 'No', $themename ); ?></span>
</div> <!-- end panel-wrap div -->
</div> <!-- end wrapper div -->
<div id="epanel-ajax-saving">
<img src="<?php echo esc_url( get_template_directory_uri() . '/core/admin/images/ajax-loader.gif' ); ?>" alt="loading" id="loading" />
<script type="text/template" id="epanel-yes-no-button-template">
<div class="et_pb_yes_no_button_wrapper">
<div class="et_pb_yes_no_button"><!-- .et_pb_on_state || .et_pb_off_state -->
<span class="et_pb_value_text et_pb_on_value"><?php esc_html_e( 'Enabled', $themename ); ?></span>
<span class="et_pb_button_slider"></span>
<span class="et_pb_value_text et_pb_off_value"><?php esc_html_e( 'Disabled', $themename ); ?></span>
#epanel p.postinfo-author .mark:after {
content: '<?php esc_html_e( "Author", $themename ); ?>';
#epanel p.postinfo-date .mark:after {
content: '<?php esc_html_e( "Date", $themename ); ?>';
#epanel p.postinfo-categories .mark:after {
content: '<?php esc_html_e( "Categories", $themename ); ?>';
#epanel p.postinfo-comments .mark:after {
content: '<?php esc_html_e( "Comments", $themename ); ?>';
#epanel p.postinfo-rating_stars .mark:after {
content: '<?php esc_html_e( "Ratings", $themename ); ?>';
/* --------------------------------------------- */
add_action( 'wp_ajax_save_epanel', 'et_epanel_save_callback' );
function et_epanel_save_callback() {
check_ajax_referer( 'epanel_nonce' );
epanel_save_data( 'ajax' );
function _et_epanel_password_mask() {
if ( ! function_exists( 'epanel_save_data' ) ) {
function epanel_save_data( $source ){
global $options, $shortname;
et_core_nonce_verified_previously();
if ( ! current_user_can( 'edit_theme_options' ) ) {
if ( defined( 'ET_BUILDER_DIR' ) && file_exists( ET_BUILDER_DIR . 'class-et-builder-settings.php' ) ) {
require_once ET_BUILDER_DIR . 'class-et-builder-settings.php';
et_builder_settings_init();
// load theme settings array
/** This filter is documented in {@see et_build_epanel()} */
$options = apply_filters( 'et_epanel_layout_data', $options );
if ( isset($_POST['action']) ) {
do_action( 'et_epanel_changing_options' );
$epanel = isset( $_GET['page'] ) ? $_GET['page'] : basename( __FILE__ );
$redirect_url = esc_url_raw( add_query_arg( 'page', $epanel, admin_url( 'admin.php' ) ) );
if ( 'save_epanel' === $_POST['action'] ) {
if ( 'ajax' !== $source ) check_admin_referer( 'epanel_nonce' );
if ( ! $updates_options = get_site_option( 'et_automatic_updates_options' ) ) {
$updates_options = get_option( 'et_automatic_updates_options', array() );
// Network Admins can edit options like Super Admins but content will be filtered
// (eg `>` in custom CSS would be encoded to `>`) so we have to disable kses filtering
// while saving epanel options.
$skip_kses = ! current_user_can( 'unfiltered_html' );
foreach ( $options as $value ) {
$et_option_name = $et_option_new_value = false;
$is_builder_field = isset( $value['is_builder_field'] ) && $value['is_builder_field'];
if ( isset( $value['id'] ) ) {
$et_option_name = $value['id'];
if ( isset( $_POST[ $value['id'] ] ) || 'checkbox_list' === $value['type'] ) {
if ( in_array( $value['type'], array( 'text', 'textlimit', 'password' ) ) ) {
if( 'password' === $value['type'] && _et_epanel_password_mask() === $_POST[$et_option_name] ) {
// The password was not modified so no need to update it
if ( isset( $value['validation_type'] ) ) {
// saves the value as integer
if ( 'number' === $value['validation_type'] ) {
$et_option_new_value = intval( stripslashes( $_POST[$value['id']] ) );
// makes sure the option is a url
if ( 'url' === $value['validation_type'] ) {
$et_option_new_value = esc_url_raw( stripslashes( $_POST[ $value['id'] ] ) );
// option is a date format
if ( 'date_format' === $value['validation_type'] ) {
$et_option_new_value = sanitize_option( 'date_format', $_POST[ $value['id'] ] );
* wp_strip_all_tags can't be used here, because it returns trimmed text, some options need spaces ( e.g 'character to separate BlogName and Post title' option )
if ( 'nohtml' === $value['validation_type'] ) {
$et_option_new_value = stripslashes( wp_filter_nohtml_kses( $_POST[$value['id']] ) );
if ( 'apikey' === $value['validation_type'] ) {
$et_option_new_value = stripslashes( sanitize_text_field( $_POST[ $value['id'] ] ) );
// use html allowed for posts if the validation type isn't provided
$et_option_new_value = wp_kses_post( stripslashes( $_POST[ $value['id'] ] ) );
} elseif ( 'select' === $value['type'] ) {
// select boxes that list pages / categories should save page/category ID ( as integer )
if ( isset( $value['et_array_for'] ) && in_array( $value['et_array_for'], array( 'pages', 'categories' ) ) ) {
$et_option_new_value = intval( stripslashes( $_POST[$value['id']] ) );
} else { // html is not allowed in select boxes
$et_option_new_value = sanitize_text_field( stripslashes( $_POST[$value['id']] ) );
} elseif ( in_array( $value['type'], array( 'checkbox', 'checkbox2' ) ) ) {
// saves 'on' value to the database, if the option is enabled
$et_option_new_value = 'on';
} elseif ( 'upload' === $value['type'] ) {
// makes sure the option is a url
$et_option_new_value = esc_url_raw( stripslashes( $_POST[ $value['id'] ] ) );
} elseif ( in_array( $value['type'], array( 'textcolorpopup', 'et_color_palette' ) ) ) {
$et_option_new_value = sanitize_text_field( stripslashes( $_POST[$value['id']] ) );
} elseif ( 'textarea' === $value['type'] ) {
if ( isset( $value['validation_type'] ) ) {
if ( 'nohtml' === $value['validation_type'] ) {
if ( $value['id'] === ( $shortname . '_custom_css' ) ) {
// save custom css into wp custom css option if supported
// fallback to legacy system otherwise
if ( function_exists( 'wp_update_custom_css_post' ) ) {
// Data sent via AJAX is automatically escaped by browser, thus it needs
// to be unslashed befor being saved into custom CSS post
wp_update_custom_css_post( wp_unslash( wp_strip_all_tags( $_POST[ $value['id'] ] ) ) );
// don't strip slashes from custom css, it should be possible to use \ for icon fonts
$et_option_new_value = wp_strip_all_tags( $_POST[ $value['id'] ] );
$et_option_new_value = wp_strip_all_tags( stripslashes( $_POST[ $value['id'] ] ) );
if ( current_user_can( 'edit_theme_options' ) ) {
$et_option_new_value = stripslashes( $_POST[ $value['id'] ] );
$et_option_new_value = stripslashes( wp_filter_post_kses( addslashes( $_POST[ $value['id'] ] ) ) ); // wp_filter_post_kses() expects slashed value
} elseif ( 'checkboxes' === $value['type'] ) {
if ( isset( $value['value_sanitize_function'] ) && 'sanitize_text_field' === $value['value_sanitize_function'] ) {
$et_option_new_value = array_map( 'sanitize_text_field', stripslashes_deep( $_POST[ $value['id'] ] ) );
// saves categories / pages IDs
$et_option_new_value = array_map( 'intval', stripslashes_deep( $_POST[ $value['id'] ] ) );
} elseif ( 'different_checkboxes' === $value['type'] ) {
// saves 'author/date/categories/comments' options
$et_option_new_value = array_map( 'sanitize_text_field', array_map( 'wp_strip_all_tags', stripslashes_deep( $_POST[$value['id']] ) ) );
} elseif ( 'checkbox_list' === $value['type'] ) {
// saves array of: 'value' => 'on' or 'off'
$raw_checked_options = isset( $_POST[ $value['id'] ] ) ? stripslashes_deep( $_POST[ $value['id'] ] ) : array();
$checkbox_options = $value['options'];
if ( is_callable( $checkbox_options ) ) {
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
$checkbox_options = call_user_func( $checkbox_options );
$allowed_values = array_values( $checkbox_options );
if ( isset( $value['et_save_values'] ) && $value['et_save_values'] ) {
$allowed_values = array_keys( $checkbox_options );
$et_option_new_value = array();
foreach ( $allowed_values as $allowed_value ) {
$et_option_new_value[ $allowed_value ] = in_array( $allowed_value, $raw_checked_options ) ? 'on' : 'off';
if ( in_array( $value['type'], array( 'checkbox', 'checkbox2' ) ) ) {
$et_option_new_value = $is_builder_field ? 'off' : 'false';
} else if ( 'different_checkboxes' === $value['type'] ) {
$et_option_new_value = array();
et_delete_option( $value['id'] );
if ( false !== $et_option_name && false !== $et_option_new_value ) {
$is_new_global_setting = false;
$global_setting_main_name = $global_setting_sub_name = '';
if ( isset( $value['is_global'] ) && $value['is_global'] ) {
$is_new_global_setting = true;
$global_setting_main_name = isset( $value['main_setting_name'] ) ? sanitize_text_field( $value['main_setting_name'] ) : '';
$global_setting_sub_name = isset( $value['sub_setting_name'] ) ? sanitize_text_field( $value['sub_setting_name'] ) : '';
* Fires before updating an ePanel option in the database.
* @param string $et_option_name The option name/id.
* @param string $et_new_option_value The new option value.
do_action( 'et_epanel_update_option', $et_option_name, $et_option_new_value );
if ( 'et_automatic_updates_options' === $global_setting_main_name ) {
$updates_options[ $global_setting_sub_name ] = $et_option_new_value;
update_site_option( $global_setting_main_name, $updates_options );
et_update_option( $et_option_name, $et_option_new_value, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name );
// Enable kses filters again
$redirect_url = add_query_arg( 'saved', 'true', $redirect_url );
if ( 'js_disabled' === $source ) {
header( "Location: " . $redirect_url );
} else if ( 'reset' === $_POST['action'] ) {
check_admin_referer( 'et-nojs-reset_epanel', '_wpnonce_reset' );
foreach ($options as $value) {
if ( isset($value['id']) ) {
et_delete_option( $value['id'] );
if ( isset( $value['std'] ) ) {
et_update_option( $value['id'], $value['std'] );
// Reset Google Maps API Key
update_option( 'et_google_api_settings', array() );
// Resets WordPress custom CSS which is synced with Options Custom CSS as of WP 4.7
if ( function_exists( 'wp_get_custom_css' ) ) {