Task_12281 (#1)

Co-authored-by: User A0264400 <a0264400@jarl.from.sh>
Reviewed-on: #1
Co-authored-by: Anton.AE <ab.an.ev@yandex.ru>
Co-committed-by: Anton.AE <ab.an.ev@yandex.ru>
This commit is contained in:
2026-07-05 16:07:04 +03:00
committed by Антон
parent 50f3a8e626
commit 3e42863ef5
2878 changed files with 59059 additions and 181273 deletions

View File

@@ -0,0 +1,38 @@
<?php
/**
* Ajax действие, которое выполняется при сохранении настроек
*
* @version 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* AJAX обработчик массовой сохранения уровня сжатия
*/
add_action(
'wp_ajax_wio_settings_update_level',
function () {
check_admin_referer( 'wio-iph' );
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( - 1 );
}
$level = sanitize_text_field( $_POST['level'] );
if ( ! $level ) {
die();
}
if ( ! in_array( $level, [ 'normal', 'aggresive', 'ultra' ] ) ) {
die();
}
WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_level', $level );
die();
}
);