Skip to content

Commit c0d9592

Browse files
committed
Update class-wpp-importer.php
1 parent f4aec30 commit c0d9592

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

includes/admin/class-wpp-importer.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,13 @@ public function handle_import_request() {
377377
$params = $this->process_import_parameters( $_POST );
378378

379379
// Determine sites.
380-
$sites = array();
381-
if ( is_multisite() && is_network_admin() ) {
382-
if ( isset( $_POST['sites'] ) && is_array( $_POST['sites'] ) ) {
383-
$sites = array_map( 'absint', $_POST['sites'] );
384-
}
385-
} else {
386-
$sites[] = get_current_blog_id();
380+
$sites = array();
381+
$is_network_admin = is_multisite() && is_network_admin();
382+
383+
if ( isset( $_POST['sites'] ) && is_array( $_POST['sites'] ) ) {
384+
$sites = array_map( 'absint', $_POST['sites'] );
385+
} elseif ( ! $is_network_admin ) {
386+
$sites[] = $params['blog_id'];
387387
}
388388

389389
if ( empty( $sites ) ) {
@@ -430,9 +430,9 @@ public function handle_import_request() {
430430
__( 'Site %1$s (ID: %2$d): Total Counts Processed: %3$d, Daily Records Processed: %4$d%5$s', 'top-ten' ),
431431
esc_html( $blog_name ),
432432
$blog_id,
433-
isset( $result['total_counts'] ) ? $result['total_counts'] : 0,
434-
isset( $result['daily_counts'] ) ? $result['daily_counts'] : 0,
435-
$params['dry_run'] ? ' (Dry Run)' : ''
433+
$result['total_counts'] ?? 0,
434+
$result['daily_counts'] ?? 0,
435+
$params['dry_run'] ? ' (' . esc_html__( 'Dry Run', 'top-10' ) . ')' : ''
436436
) . '<br>';
437437
}
438438

0 commit comments

Comments
 (0)