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/epanel
File: core_functions.php
<div class="et_pb_colorpalette_overview">
[500] Fix | Delete
<?php
[501] Fix | Delete
for ( $colorpalette_index = 1; $colorpalette_index <= $items_amount; $colorpalette_index++ ) { ?>
[502] Fix | Delete
<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>
[503] Fix | Delete
<?php } ?>
[504] Fix | Delete
[505] Fix | Delete
</div>
[506] Fix | Delete
[507] Fix | Delete
<?php for ( $colorpicker_index = 1; $colorpicker_index <= $items_amount; $colorpicker_index++ ) { ?>
[508] Fix | Delete
<div class="colorpalette-colorpicker" data-index="<?php echo esc_attr( $colorpicker_index ); ?>">
[509] Fix | Delete
<input data-index="<?php echo esc_attr( $colorpicker_index ); ?>" type="text" class="input-colorpalette-colorpicker" data-alpha="true" />
[510] Fix | Delete
</div>
[511] Fix | Delete
<?php } ?>
[512] Fix | Delete
[513] Fix | Delete
<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 ); ?>" />
[514] Fix | Delete
[515] Fix | Delete
<?php } ?>
[516] Fix | Delete
[517] Fix | Delete
</div> <!-- end et-box-content div -->
[518] Fix | Delete
<span class="et-box-description"></span>
[519] Fix | Delete
</div> <!-- end et-epanel-box div -->
[520] Fix | Delete
[521] Fix | Delete
<?php } elseif ( 'checkbox' === $value['type'] || 'checkbox2' === $value['type'] ) { ?>
[522] Fix | Delete
<?php
[523] Fix | Delete
$et_box_class = 'checkbox' === $value['type'] ? 'et-epanel-box-small-1' : 'et-epanel-box-small-2';
[524] Fix | Delete
?>
[525] Fix | Delete
<div class="<?php echo esc_attr( 'et-epanel-box ' . $et_box_class . $hidden_option_classname ); ?>">
[526] Fix | Delete
<div class="et-box-title"><h3><?php echo esc_html( $value['name'] ); ?></h3>
[527] Fix | Delete
<div class="et-box-descr">
[528] Fix | Delete
<p><?php
[529] Fix | Delete
echo wp_kses( $value['desc'], array(
[530] Fix | Delete
'a' => array(
[531] Fix | Delete
'href' => array(),
[532] Fix | Delete
'title' => array(),
[533] Fix | Delete
'target' => array(),
[534] Fix | Delete
),
[535] Fix | Delete
) );
[536] Fix | Delete
?></p>
[537] Fix | Delete
</div> <!-- end et-box-desc-content div -->
[538] Fix | Delete
</div> <!-- end div et-box-title -->
[539] Fix | Delete
<div class="et-box-content">
[540] Fix | Delete
<?php
[541] Fix | Delete
$checked = '';
[542] Fix | Delete
$value_id = et_get_option( $value['id'] );
[543] Fix | Delete
[544] Fix | Delete
if ( $is_new_global_setting && isset( $value['main_setting_name'] ) && isset( $value['sub_setting_name'] ) ) {
[545] Fix | Delete
$saved_checkbox = et_get_option( $value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name );
[546] Fix | Delete
$checked = ( 'on' === $saved_checkbox || (!$saved_checkbox && 'on' === $value['std']) ) ?
[547] Fix | Delete
'checked="checked"' : '';
[548] Fix | Delete
} else if ( ! empty( $value_id ) ) {
[549] Fix | Delete
if ( 'on' === $value_id ) {
[550] Fix | Delete
$checked = 'checked="checked"';
[551] Fix | Delete
} else {
[552] Fix | Delete
$checked = '';
[553] Fix | Delete
}
[554] Fix | Delete
} else if ( 'on' === $value['std'] ) {
[555] Fix | Delete
$checked = 'checked="checked"';
[556] Fix | Delete
}
[557] Fix | Delete
?>
[558] Fix | Delete
[559] Fix | Delete
<?php if ( isset( $value['hidden_option_message'] ) && $is_hidden_option ) : ?>
[560] Fix | Delete
<div class="et-hidden-option-message">
[561] Fix | Delete
<?php echo et_core_esc_previously( wpautop( esc_html( $value['hidden_option_message'] ) ) ); ?>
[562] Fix | Delete
</div>
[563] Fix | Delete
<?php endif; ?>
[564] Fix | Delete
<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 );?>/>
[565] Fix | Delete
[566] Fix | Delete
</div> <!-- end et-box-content div -->
[567] Fix | Delete
<?php if ( 'et_pb_static_css_file' === $value['id'] ) { ?>
[568] Fix | Delete
<span class="et-button"><?php echo esc_html_x( 'Clear', 'clear static resources', $themename ); ?></span>
[569] Fix | Delete
<?php } ?>
[570] Fix | Delete
<span class="et-box-description"></span>
[571] Fix | Delete
</div> <!-- end epanel-box-small div -->
[572] Fix | Delete
[573] Fix | Delete
<?php } elseif ( 'checkbox_list' === $value['type'] ) { ?>
[574] Fix | Delete
[575] Fix | Delete
<div class="<?php echo esc_attr( 'et-epanel-box et-epanel-box__checkbox-list' . $hidden_option_classname ); ?>">
[576] Fix | Delete
<div class="et-box-title">
[577] Fix | Delete
<h3><?php echo esc_html( $value['name'] ); ?></h3>
[578] Fix | Delete
<div class="et-box-descr">
[579] Fix | Delete
<p>
[580] Fix | Delete
<?php
[581] Fix | Delete
echo wp_kses( $value['desc'], array(
[582] Fix | Delete
'a' => array(
[583] Fix | Delete
'href' => array(),
[584] Fix | Delete
'title' => array(),
[585] Fix | Delete
'target' => array(),
[586] Fix | Delete
),
[587] Fix | Delete
) );
[588] Fix | Delete
?>
[589] Fix | Delete
</p>
[590] Fix | Delete
</div> <!-- end et-box-descr div -->
[591] Fix | Delete
</div> <!-- end div et-box-title -->
[592] Fix | Delete
<div class="et-box-content et-epanel-box-small-2">
[593] Fix | Delete
<div class="et-box-content--list">
[594] Fix | Delete
<?php
[595] Fix | Delete
if ( empty( $value['options'] ) ) {
[596] Fix | Delete
esc_html_e( 'No available options.', $themename );
[597] Fix | Delete
} else {
[598] Fix | Delete
$defaults = ( isset( $value['default'] ) && is_array( $value['default'] ) ) ? $value['default'] : array();
[599] Fix | Delete
$stored_values = et_get_option( $value['id'], array() );
[600] Fix | Delete
$value_options = $value['options'];
[601] Fix | Delete
if ( is_callable( $value_options ) ) {
[602] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[603] Fix | Delete
$value_options = call_user_func( $value_options );
[604] Fix | Delete
}
[605] Fix | Delete
[606] Fix | Delete
foreach ( $value_options as $option_key => $option ) {
[607] Fix | Delete
$option_value = isset( $value['et_save_values'] ) && $value['et_save_values'] ? sanitize_text_field( $option_key ) : sanitize_text_field( $option );
[608] Fix | Delete
$option_label = sanitize_text_field( $option );
[609] Fix | Delete
$checked = isset( $defaults[ $option_value ] ) ? $defaults[ $option_value ] : 'off';
[610] Fix | Delete
if ( isset( $stored_values[ $option_value ] ) ) {
[611] Fix | Delete
$checked = $stored_values[ $option_value ];
[612] Fix | Delete
}
[613] Fix | Delete
$checked = 'on' === $checked ? 'checked="checked"' : '';
[614] Fix | Delete
$checkbox_list_id = sanitize_text_field( $value['id'] . '-' . $option_key );
[615] Fix | Delete
?>
[616] Fix | Delete
<div class="et-box-content">
[617] Fix | Delete
<span class="et-panel-box__checkbox-list-label">
[618] Fix | Delete
<?php echo esc_html( $option_label ); ?>
[619] Fix | Delete
</span>
[620] Fix | Delete
<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 ); ?> />
[621] Fix | Delete
</div> <!-- end et-box-content div -->
[622] Fix | Delete
<?php
[623] Fix | Delete
}
[624] Fix | Delete
}
[625] Fix | Delete
?>
[626] Fix | Delete
</div>
[627] Fix | Delete
</div>
[628] Fix | Delete
<span class="et-box-description"></span>
[629] Fix | Delete
</div> <!-- end epanel-box-small div -->
[630] Fix | Delete
[631] Fix | Delete
<?php } elseif ( 'support' === $value['type'] ) { ?>
[632] Fix | Delete
[633] Fix | Delete
<div class="inner-content">
[634] Fix | Delete
<?php include get_template_directory() . "/includes/functions/" . $value['name'] . ".php"; ?>
[635] Fix | Delete
</div>
[636] Fix | Delete
[637] Fix | Delete
<?php } elseif ( 'contenttab-wrapstart' === $value['type'] || 'subcontent-start' === $value['type'] ) { ?>
[638] Fix | Delete
[639] Fix | Delete
<?php $et_contenttab_class = 'contenttab-wrapstart' === $value['type'] ? 'et-content-div' : 'et-tab-content'; ?>
[640] Fix | Delete
[641] Fix | Delete
<div id="<?php echo esc_attr( $value['name'] ); ?>" class="<?php echo esc_attr( $et_contenttab_class ); ?>">
[642] Fix | Delete
[643] Fix | Delete
<?php } elseif ( 'contenttab-wrapend' === $value['type'] || 'subcontent-end' === $value['type'] ) { ?>
[644] Fix | Delete
[645] Fix | Delete
</div> <!-- end <?php echo esc_html( $value['name'] ); ?> div -->
[646] Fix | Delete
[647] Fix | Delete
<?php } elseif ( 'subnavtab-start' === $value['type'] ) { ?>
[648] Fix | Delete
[649] Fix | Delete
<ul class="et-id-tabs">
[650] Fix | Delete
[651] Fix | Delete
<?php } elseif ( 'subnavtab-end' === $value['type'] ) { ?>
[652] Fix | Delete
[653] Fix | Delete
</ul>
[654] Fix | Delete
[655] Fix | Delete
<?php } elseif ( 'subnav-tab' === $value['type'] ) { ?>
[656] Fix | Delete
[657] Fix | Delete
<li><a href="#<?php echo esc_attr( $value['name'] ); ?>"><span class="pngfix"><?php echo esc_html( $value['desc'] ); ?></span></a></li>
[658] Fix | Delete
[659] Fix | Delete
<?php } elseif ($value['type'] === "clearfix") { ?>
[660] Fix | Delete
[661] Fix | Delete
<div class="et-clearfix"></div>
[662] Fix | Delete
[663] Fix | Delete
<?php } ?>
[664] Fix | Delete
[665] Fix | Delete
<?php } //end foreach ($options as $value) ?>
[666] Fix | Delete
[667] Fix | Delete
</div> <!-- end epanel-content div -->
[668] Fix | Delete
</div> <!-- end epanel-content-wrap div -->
[669] Fix | Delete
</div> <!-- end epanel div -->
[670] Fix | Delete
</div> <!-- end epanel-wrapper div -->
[671] Fix | Delete
[672] Fix | Delete
<div id="epanel-bottom">
[673] Fix | Delete
<?php wp_nonce_field( 'epanel_nonce' ); ?>
[674] Fix | Delete
<button class="et-save-button" name="save" id="epanel-save"><?php esc_html_e( 'Save Changes', $themename ); ?></button>
[675] Fix | Delete
[676] Fix | Delete
<input type="hidden" name="action" value="save_epanel" />
[677] Fix | Delete
</div><!-- end epanel-bottom div -->
[678] Fix | Delete
[679] Fix | Delete
</form>
[680] Fix | Delete
[681] Fix | Delete
<div class="reset-popup-overlay">
[682] Fix | Delete
<div class="defaults-hover">
[683] Fix | Delete
<div class="reset-popup-header"><?php esc_html_e( 'Reset', $themename ); ?></div>
[684] Fix | Delete
<?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 ) ); ?>
[685] Fix | Delete
<div class="et-clearfix"></div>
[686] Fix | Delete
<form method="post">
[687] Fix | Delete
<?php wp_nonce_field( 'et-nojs-reset_epanel', '_wpnonce_reset' ); ?>
[688] Fix | Delete
<input name="reset" type="submit" value="<?php esc_attr_e( 'Yes', $themename ); ?>" id="epanel-reset" />
[689] Fix | Delete
<input type="hidden" name="action" value="reset" />
[690] Fix | Delete
</form>
[691] Fix | Delete
<span class="no"><?php esc_html_e( 'No', $themename ); ?></span>
[692] Fix | Delete
</div>
[693] Fix | Delete
</div>
[694] Fix | Delete
[695] Fix | Delete
</div> <!-- end panel-wrap div -->
[696] Fix | Delete
</div> <!-- end wrapper div -->
[697] Fix | Delete
[698] Fix | Delete
<div id="epanel-ajax-saving">
[699] Fix | Delete
<img src="<?php echo esc_url( get_template_directory_uri() . '/core/admin/images/ajax-loader.gif' ); ?>" alt="loading" id="loading" />
[700] Fix | Delete
</div>
[701] Fix | Delete
[702] Fix | Delete
<script type="text/template" id="epanel-yes-no-button-template">
[703] Fix | Delete
<div class="et_pb_yes_no_button_wrapper">
[704] Fix | Delete
<div class="et_pb_yes_no_button"><!-- .et_pb_on_state || .et_pb_off_state -->
[705] Fix | Delete
<span class="et_pb_value_text et_pb_on_value"><?php esc_html_e( 'Enabled', $themename ); ?></span>
[706] Fix | Delete
<span class="et_pb_button_slider"></span>
[707] Fix | Delete
<span class="et_pb_value_text et_pb_off_value"><?php esc_html_e( 'Disabled', $themename ); ?></span>
[708] Fix | Delete
</div>
[709] Fix | Delete
</div>
[710] Fix | Delete
</script>
[711] Fix | Delete
[712] Fix | Delete
<style type="text/css">
[713] Fix | Delete
#epanel p.postinfo-author .mark:after {
[714] Fix | Delete
content: '<?php esc_html_e( "Author", $themename ); ?>';
[715] Fix | Delete
}
[716] Fix | Delete
[717] Fix | Delete
#epanel p.postinfo-date .mark:after {
[718] Fix | Delete
content: '<?php esc_html_e( "Date", $themename ); ?>';
[719] Fix | Delete
}
[720] Fix | Delete
[721] Fix | Delete
#epanel p.postinfo-categories .mark:after {
[722] Fix | Delete
content: '<?php esc_html_e( "Categories", $themename ); ?>';
[723] Fix | Delete
}
[724] Fix | Delete
[725] Fix | Delete
#epanel p.postinfo-comments .mark:after {
[726] Fix | Delete
content: '<?php esc_html_e( "Comments", $themename ); ?>';
[727] Fix | Delete
}
[728] Fix | Delete
[729] Fix | Delete
#epanel p.postinfo-rating_stars .mark:after {
[730] Fix | Delete
content: '<?php esc_html_e( "Ratings", $themename ); ?>';
[731] Fix | Delete
}
[732] Fix | Delete
</style>
[733] Fix | Delete
[734] Fix | Delete
<?php
[735] Fix | Delete
}
[736] Fix | Delete
[737] Fix | Delete
}
[738] Fix | Delete
/* --------------------------------------------- */
[739] Fix | Delete
[740] Fix | Delete
add_action( 'wp_ajax_save_epanel', 'et_epanel_save_callback' );
[741] Fix | Delete
[742] Fix | Delete
function et_epanel_save_callback() {
[743] Fix | Delete
check_ajax_referer( 'epanel_nonce' );
[744] Fix | Delete
epanel_save_data( 'ajax' );
[745] Fix | Delete
[746] Fix | Delete
die();
[747] Fix | Delete
}
[748] Fix | Delete
[749] Fix | Delete
function _et_epanel_password_mask() {
[750] Fix | Delete
return '************';
[751] Fix | Delete
}
[752] Fix | Delete
[753] Fix | Delete
if ( ! function_exists( 'epanel_save_data' ) ) {
[754] Fix | Delete
[755] Fix | Delete
function epanel_save_data( $source ){
[756] Fix | Delete
global $options, $shortname;
[757] Fix | Delete
[758] Fix | Delete
et_core_nonce_verified_previously();
[759] Fix | Delete
[760] Fix | Delete
if ( ! current_user_can( 'edit_theme_options' ) ) {
[761] Fix | Delete
die('-1');
[762] Fix | Delete
}
[763] Fix | Delete
[764] Fix | Delete
if ( defined( 'ET_BUILDER_DIR' ) && file_exists( ET_BUILDER_DIR . 'class-et-builder-settings.php' ) ) {
[765] Fix | Delete
require_once ET_BUILDER_DIR . 'class-et-builder-settings.php';
[766] Fix | Delete
et_builder_settings_init();
[767] Fix | Delete
}
[768] Fix | Delete
[769] Fix | Delete
// load theme settings array
[770] Fix | Delete
et_load_core_options();
[771] Fix | Delete
[772] Fix | Delete
/** This filter is documented in {@see et_build_epanel()} */
[773] Fix | Delete
$options = apply_filters( 'et_epanel_layout_data', $options );
[774] Fix | Delete
[775] Fix | Delete
if ( isset($_POST['action']) ) {
[776] Fix | Delete
do_action( 'et_epanel_changing_options' );
[777] Fix | Delete
[778] Fix | Delete
$epanel = isset( $_GET['page'] ) ? $_GET['page'] : basename( __FILE__ );
[779] Fix | Delete
$redirect_url = esc_url_raw( add_query_arg( 'page', $epanel, admin_url( 'admin.php' ) ) );
[780] Fix | Delete
[781] Fix | Delete
if ( 'save_epanel' === $_POST['action'] ) {
[782] Fix | Delete
if ( 'ajax' !== $source ) check_admin_referer( 'epanel_nonce' );
[783] Fix | Delete
[784] Fix | Delete
if ( ! $updates_options = get_site_option( 'et_automatic_updates_options' ) ) {
[785] Fix | Delete
$updates_options = get_option( 'et_automatic_updates_options', array() );
[786] Fix | Delete
}
[787] Fix | Delete
[788] Fix | Delete
// Network Admins can edit options like Super Admins but content will be filtered
[789] Fix | Delete
// (eg `>` in custom CSS would be encoded to `&gt;`) so we have to disable kses filtering
[790] Fix | Delete
// while saving epanel options.
[791] Fix | Delete
$skip_kses = ! current_user_can( 'unfiltered_html' );
[792] Fix | Delete
if ( $skip_kses ) {
[793] Fix | Delete
kses_remove_filters();
[794] Fix | Delete
}
[795] Fix | Delete
[796] Fix | Delete
foreach ( $options as $value ) {
[797] Fix | Delete
$et_option_name = $et_option_new_value = false;
[798] Fix | Delete
$is_builder_field = isset( $value['is_builder_field'] ) && $value['is_builder_field'];
[799] Fix | Delete
[800] Fix | Delete
if ( isset( $value['id'] ) ) {
[801] Fix | Delete
$et_option_name = $value['id'];
[802] Fix | Delete
[803] Fix | Delete
if ( isset( $_POST[ $value['id'] ] ) || 'checkbox_list' === $value['type'] ) {
[804] Fix | Delete
if ( in_array( $value['type'], array( 'text', 'textlimit', 'password' ) ) ) {
[805] Fix | Delete
[806] Fix | Delete
if( 'password' === $value['type'] && _et_epanel_password_mask() === $_POST[$et_option_name] ) {
[807] Fix | Delete
// The password was not modified so no need to update it
[808] Fix | Delete
continue;
[809] Fix | Delete
}
[810] Fix | Delete
[811] Fix | Delete
if ( isset( $value['validation_type'] ) ) {
[812] Fix | Delete
// saves the value as integer
[813] Fix | Delete
if ( 'number' === $value['validation_type'] ) {
[814] Fix | Delete
$et_option_new_value = intval( stripslashes( $_POST[$value['id']] ) );
[815] Fix | Delete
}
[816] Fix | Delete
[817] Fix | Delete
// makes sure the option is a url
[818] Fix | Delete
if ( 'url' === $value['validation_type'] ) {
[819] Fix | Delete
$et_option_new_value = esc_url_raw( stripslashes( $_POST[ $value['id'] ] ) );
[820] Fix | Delete
}
[821] Fix | Delete
[822] Fix | Delete
// option is a date format
[823] Fix | Delete
if ( 'date_format' === $value['validation_type'] ) {
[824] Fix | Delete
$et_option_new_value = sanitize_option( 'date_format', $_POST[ $value['id'] ] );
[825] Fix | Delete
}
[826] Fix | Delete
[827] Fix | Delete
/*
[828] Fix | Delete
* html is not allowed
[829] Fix | Delete
* 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 )
[830] Fix | Delete
*/
[831] Fix | Delete
if ( 'nohtml' === $value['validation_type'] ) {
[832] Fix | Delete
$et_option_new_value = stripslashes( wp_filter_nohtml_kses( $_POST[$value['id']] ) );
[833] Fix | Delete
}
[834] Fix | Delete
if ( 'apikey' === $value['validation_type'] ) {
[835] Fix | Delete
$et_option_new_value = stripslashes( sanitize_text_field( $_POST[ $value['id'] ] ) );
[836] Fix | Delete
}
[837] Fix | Delete
} else {
[838] Fix | Delete
// use html allowed for posts if the validation type isn't provided
[839] Fix | Delete
$et_option_new_value = wp_kses_post( stripslashes( $_POST[ $value['id'] ] ) );
[840] Fix | Delete
}
[841] Fix | Delete
[842] Fix | Delete
} elseif ( 'select' === $value['type'] ) {
[843] Fix | Delete
[844] Fix | Delete
// select boxes that list pages / categories should save page/category ID ( as integer )
[845] Fix | Delete
if ( isset( $value['et_array_for'] ) && in_array( $value['et_array_for'], array( 'pages', 'categories' ) ) ) {
[846] Fix | Delete
$et_option_new_value = intval( stripslashes( $_POST[$value['id']] ) );
[847] Fix | Delete
} else { // html is not allowed in select boxes
[848] Fix | Delete
$et_option_new_value = sanitize_text_field( stripslashes( $_POST[$value['id']] ) );
[849] Fix | Delete
}
[850] Fix | Delete
[851] Fix | Delete
} elseif ( in_array( $value['type'], array( 'checkbox', 'checkbox2' ) ) ) {
[852] Fix | Delete
[853] Fix | Delete
// saves 'on' value to the database, if the option is enabled
[854] Fix | Delete
$et_option_new_value = 'on';
[855] Fix | Delete
[856] Fix | Delete
} elseif ( 'upload' === $value['type'] ) {
[857] Fix | Delete
[858] Fix | Delete
// makes sure the option is a url
[859] Fix | Delete
$et_option_new_value = esc_url_raw( stripslashes( $_POST[ $value['id'] ] ) );
[860] Fix | Delete
[861] Fix | Delete
} elseif ( in_array( $value['type'], array( 'textcolorpopup', 'et_color_palette' ) ) ) {
[862] Fix | Delete
[863] Fix | Delete
// the color value
[864] Fix | Delete
$et_option_new_value = sanitize_text_field( stripslashes( $_POST[$value['id']] ) );
[865] Fix | Delete
[866] Fix | Delete
} elseif ( 'textarea' === $value['type'] ) {
[867] Fix | Delete
[868] Fix | Delete
if ( isset( $value['validation_type'] ) ) {
[869] Fix | Delete
// html is not allowed
[870] Fix | Delete
if ( 'nohtml' === $value['validation_type'] ) {
[871] Fix | Delete
if ( $value['id'] === ( $shortname . '_custom_css' ) ) {
[872] Fix | Delete
// save custom css into wp custom css option if supported
[873] Fix | Delete
// fallback to legacy system otherwise
[874] Fix | Delete
if ( function_exists( 'wp_update_custom_css_post' ) ) {
[875] Fix | Delete
// Data sent via AJAX is automatically escaped by browser, thus it needs
[876] Fix | Delete
// to be unslashed befor being saved into custom CSS post
[877] Fix | Delete
wp_update_custom_css_post( wp_unslash( wp_strip_all_tags( $_POST[ $value['id'] ] ) ) );
[878] Fix | Delete
} else {
[879] Fix | Delete
// don't strip slashes from custom css, it should be possible to use \ for icon fonts
[880] Fix | Delete
$et_option_new_value = wp_strip_all_tags( $_POST[ $value['id'] ] );
[881] Fix | Delete
}
[882] Fix | Delete
} else {
[883] Fix | Delete
$et_option_new_value = wp_strip_all_tags( stripslashes( $_POST[ $value['id'] ] ) );
[884] Fix | Delete
}
[885] Fix | Delete
}
[886] Fix | Delete
} else {
[887] Fix | Delete
if ( current_user_can( 'edit_theme_options' ) ) {
[888] Fix | Delete
$et_option_new_value = stripslashes( $_POST[ $value['id'] ] );
[889] Fix | Delete
} else {
[890] Fix | Delete
$et_option_new_value = stripslashes( wp_filter_post_kses( addslashes( $_POST[ $value['id'] ] ) ) ); // wp_filter_post_kses() expects slashed value
[891] Fix | Delete
}
[892] Fix | Delete
}
[893] Fix | Delete
[894] Fix | Delete
} elseif ( 'checkboxes' === $value['type'] ) {
[895] Fix | Delete
[896] Fix | Delete
if ( isset( $value['value_sanitize_function'] ) && 'sanitize_text_field' === $value['value_sanitize_function'] ) {
[897] Fix | Delete
// strings
[898] Fix | Delete
$et_option_new_value = array_map( 'sanitize_text_field', stripslashes_deep( $_POST[ $value['id'] ] ) );
[899] Fix | Delete
} else {
[900] Fix | Delete
// saves categories / pages IDs
[901] Fix | Delete
$et_option_new_value = array_map( 'intval', stripslashes_deep( $_POST[ $value['id'] ] ) );
[902] Fix | Delete
}
[903] Fix | Delete
[904] Fix | Delete
} elseif ( 'different_checkboxes' === $value['type'] ) {
[905] Fix | Delete
[906] Fix | Delete
// saves 'author/date/categories/comments' options
[907] Fix | Delete
$et_option_new_value = array_map( 'sanitize_text_field', array_map( 'wp_strip_all_tags', stripslashes_deep( $_POST[$value['id']] ) ) );
[908] Fix | Delete
[909] Fix | Delete
} elseif ( 'checkbox_list' === $value['type'] ) {
[910] Fix | Delete
// saves array of: 'value' => 'on' or 'off'
[911] Fix | Delete
$raw_checked_options = isset( $_POST[ $value['id'] ] ) ? stripslashes_deep( $_POST[ $value['id'] ] ) : array();
[912] Fix | Delete
$checkbox_options = $value['options'];
[913] Fix | Delete
[914] Fix | Delete
if ( is_callable( $checkbox_options ) ) {
[915] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[916] Fix | Delete
$checkbox_options = call_user_func( $checkbox_options );
[917] Fix | Delete
}
[918] Fix | Delete
[919] Fix | Delete
$allowed_values = array_values( $checkbox_options );
[920] Fix | Delete
[921] Fix | Delete
if ( isset( $value['et_save_values'] ) && $value['et_save_values'] ) {
[922] Fix | Delete
$allowed_values = array_keys( $checkbox_options );
[923] Fix | Delete
}
[924] Fix | Delete
[925] Fix | Delete
$et_option_new_value = array();
[926] Fix | Delete
[927] Fix | Delete
foreach ( $allowed_values as $allowed_value ) {
[928] Fix | Delete
$et_option_new_value[ $allowed_value ] = in_array( $allowed_value, $raw_checked_options ) ? 'on' : 'off';
[929] Fix | Delete
}
[930] Fix | Delete
}
[931] Fix | Delete
} else {
[932] Fix | Delete
if ( in_array( $value['type'], array( 'checkbox', 'checkbox2' ) ) ) {
[933] Fix | Delete
$et_option_new_value = $is_builder_field ? 'off' : 'false';
[934] Fix | Delete
} else if ( 'different_checkboxes' === $value['type'] ) {
[935] Fix | Delete
$et_option_new_value = array();
[936] Fix | Delete
} else {
[937] Fix | Delete
et_delete_option( $value['id'] );
[938] Fix | Delete
}
[939] Fix | Delete
}
[940] Fix | Delete
[941] Fix | Delete
if ( false !== $et_option_name && false !== $et_option_new_value ) {
[942] Fix | Delete
$is_new_global_setting = false;
[943] Fix | Delete
$global_setting_main_name = $global_setting_sub_name = '';
[944] Fix | Delete
[945] Fix | Delete
if ( isset( $value['is_global'] ) && $value['is_global'] ) {
[946] Fix | Delete
$is_new_global_setting = true;
[947] Fix | Delete
$global_setting_main_name = isset( $value['main_setting_name'] ) ? sanitize_text_field( $value['main_setting_name'] ) : '';
[948] Fix | Delete
$global_setting_sub_name = isset( $value['sub_setting_name'] ) ? sanitize_text_field( $value['sub_setting_name'] ) : '';
[949] Fix | Delete
}
[950] Fix | Delete
[951] Fix | Delete
/**
[952] Fix | Delete
* Fires before updating an ePanel option in the database.
[953] Fix | Delete
*
[954] Fix | Delete
* @param string $et_option_name The option name/id.
[955] Fix | Delete
* @param string $et_new_option_value The new option value.
[956] Fix | Delete
*/
[957] Fix | Delete
do_action( 'et_epanel_update_option', $et_option_name, $et_option_new_value );
[958] Fix | Delete
[959] Fix | Delete
if ( 'et_automatic_updates_options' === $global_setting_main_name ) {
[960] Fix | Delete
$updates_options[ $global_setting_sub_name ] = $et_option_new_value;
[961] Fix | Delete
[962] Fix | Delete
update_site_option( $global_setting_main_name, $updates_options );
[963] Fix | Delete
} else {
[964] Fix | Delete
et_update_option( $et_option_name, $et_option_new_value, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name );
[965] Fix | Delete
}
[966] Fix | Delete
}
[967] Fix | Delete
}
[968] Fix | Delete
}
[969] Fix | Delete
[970] Fix | Delete
if ( $skip_kses ) {
[971] Fix | Delete
// Enable kses filters again
[972] Fix | Delete
kses_init_filters();
[973] Fix | Delete
}
[974] Fix | Delete
[975] Fix | Delete
$redirect_url = add_query_arg( 'saved', 'true', $redirect_url );
[976] Fix | Delete
[977] Fix | Delete
if ( 'js_disabled' === $source ) {
[978] Fix | Delete
header( "Location: " . $redirect_url );
[979] Fix | Delete
}
[980] Fix | Delete
die('1');
[981] Fix | Delete
[982] Fix | Delete
} else if ( 'reset' === $_POST['action'] ) {
[983] Fix | Delete
check_admin_referer( 'et-nojs-reset_epanel', '_wpnonce_reset' );
[984] Fix | Delete
[985] Fix | Delete
foreach ($options as $value) {
[986] Fix | Delete
if ( isset($value['id']) ) {
[987] Fix | Delete
et_delete_option( $value['id'] );
[988] Fix | Delete
if ( isset( $value['std'] ) ) {
[989] Fix | Delete
et_update_option( $value['id'], $value['std'] );
[990] Fix | Delete
}
[991] Fix | Delete
}
[992] Fix | Delete
}
[993] Fix | Delete
[994] Fix | Delete
// Reset Google Maps API Key
[995] Fix | Delete
update_option( 'et_google_api_settings', array() );
[996] Fix | Delete
[997] Fix | Delete
// Resets WordPress custom CSS which is synced with Options Custom CSS as of WP 4.7
[998] Fix | Delete
if ( function_exists( 'wp_get_custom_css' ) ) {
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function