backup.php
7 months ago
index.php
3 years ago
logs.php
7 months ago
meta-migrations.php
7 months ago
multisite-update-current-blog.php
7 months ago
settings.php
7 months ago
multisite-update-current-blog.php
29 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Ajax действие, которое выполняется для смены текущего multisite блога |
| 4 | * |
| 5 | * @version 1.0 |
| 6 | */ |
| 7 | |
| 8 | // Exit if accessed directly |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | /* |
| 14 | add_action( 'wp_ajax_wbcr_rio_update_current_blog', function () { |
| 15 | check_ajax_referer( 'update_blog_id', 'wpnonce' ); |
| 16 | $blog_id = (int) WRIO_Plugin::app()->request->post( 'current_blog_id' ); |
| 17 | $context = sanitize_text_field( WRIO_Plugin::app()->request->post( 'context' ) ); |
| 18 | WRIO_Plugin::app()->updatePopulateOption( 'current_blog', $blog_id ); |
| 19 | $image_statistics = WIO_OptimizationTools::getImageStatistics( $context ); |
| 20 | |
| 21 | switch_to_blog( $blog_id ); |
| 22 | $statistic_data = $image_statistics->load(); |
| 23 | restore_current_blog(); |
| 24 | |
| 25 | wp_send_json_success( array( |
| 26 | 'statistic' => $statistic_data, |
| 27 | ) ); |
| 28 | } );*/ |
| 29 |