Skip to content

Commit 93a91d9

Browse files
committed
Networks and Sites: Correct and improve terminology relating to deactivated, deleted, and archived sites on a Multisite installation.
* Deleting a site is permanent action, so the terminology around site deletion has been updated to reflect that. * Site deactivation has been renamed to "Flag for Deletion", and a site with this status is no longer incorrectly shown as "Deleted". * Extra helper text has been added to the screen shown when changing a site's status to make the effects clearer to Super Admins. Props kawauso, ryan_b, wonderboymusic, nacin, DrewAPicture, martythornley, SergeyBiryukov, jeremyfelt, ideag, jorbin, sukhendu2002, johnbillion, realloc. Fixes #15801 git-svn-id: https://develop.svn.wordpress.org/trunk@60358 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3f3fa0f commit 93a91d9

File tree

7 files changed

+44
-30
lines changed

7 files changed

+44
-30
lines changed

src/wp-admin/includes/class-wp-ms-sites-list-table.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct( $args = array() ) {
3737
$this->status_list = array(
3838
'archived' => array( 'site-archived', __( 'Archived' ) ),
3939
'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ),
40-
'deleted' => array( 'site-deleted', __( 'Deleted' ) ),
40+
'deleted' => array( 'site-deleted', __( 'Flagged for Deletion' ) ),
4141
'mature' => array( 'site-mature', __( 'Mature' ) ),
4242
);
4343

@@ -256,8 +256,8 @@ protected function get_views() {
256256

257257
/* translators: %s: Number of sites. */
258258
'deleted' => _n_noop(
259-
'Deleted <span class="count">(%s)</span>',
260-
'Deleted <span class="count">(%s)</span>'
259+
'Flagged for Deletion <span class="count">(%s)</span>',
260+
'Flagged for Deletion <span class="count">(%s)</span>'
261261
),
262262
);
263263

@@ -667,7 +667,7 @@ protected function site_states( $site ) {
667667
* @since 5.3.0
668668
*
669669
* @param string[] $site_states An array of site states. Default 'Main',
670-
* 'Archived', 'Mature', 'Spam', 'Deleted'.
670+
* 'Archived', 'Mature', 'Spam', 'Flagged for Deletion'.
671671
* @param WP_Site $site The current site object.
672672
*/
673673
$site_states = apply_filters( 'display_site_states', $site_states, $_site );
@@ -758,7 +758,7 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
758758
'activateblog_' . $blog['blog_id']
759759
)
760760
),
761-
_x( 'Activate', 'site' )
761+
_x( 'Remove Deletion Flag', 'site' )
762762
);
763763
} else {
764764
$actions['deactivate'] = sprintf(
@@ -769,7 +769,7 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
769769
'deactivateblog_' . $blog['blog_id']
770770
)
771771
),
772-
__( 'Deactivate' )
772+
__( 'Flag for Deletion' )
773773
);
774774
}
775775

@@ -830,7 +830,7 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
830830
'deleteblog_' . $blog['blog_id']
831831
)
832832
),
833-
__( 'Delete' )
833+
__( 'Delete Permanently' )
834834
);
835835
}
836836
}
@@ -844,9 +844,9 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
844844
/**
845845
* Filters the action links displayed for each site in the Sites list table.
846846
*
847-
* The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by
847+
* The 'Edit', 'Dashboard', 'Delete Permanently', and 'Visit' links are displayed by
848848
* default for each site. The site's status determines whether to show the
849-
* 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and
849+
* 'Remove Deletion Flag' or 'Flag for Deletion' link, 'Unarchive' or 'Archive' links, and
850850
* 'Not Spam' or 'Spam' link for each site.
851851
*
852852
* @since 3.1.0

src/wp-admin/menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ function _add_plugin_file_editor_to_tools() {
378378
$submenu['tools.php'][20] = array( sprintf( __( 'Site Health %s' ), $site_health_count ), 'view_site_health_checks', 'site-health.php' );
379379
$submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' );
380380
$submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' );
381-
if ( is_multisite() && ! is_main_site() ) {
381+
if ( is_multisite() && ! is_main_site() && '1' !== get_site()->deleted ) {
382382
$submenu['tools.php'][35] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
383383
}
384384
if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {

src/wp-admin/network/site-info.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
if ( ! $is_main_site ) {
201201
$attribute_fields['archived'] = __( 'Archived' );
202202
$attribute_fields['spam'] = _x( 'Spam', 'site' );
203-
$attribute_fields['deleted'] = __( 'Deleted' );
203+
$attribute_fields['deleted'] = __( 'Flagged for Deletion' );
204204
}
205205
$attribute_fields['mature'] = __( 'Mature' );
206206
?>

src/wp-admin/network/sites.php

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
'<p>' . __( 'Hovering over each site reveals seven options (three for the primary site):' ) . '</p>' .
3434
'<ul><li>' . __( 'An Edit link to a separate Edit Site screen.' ) . '</li>' .
3535
'<li>' . __( 'Dashboard leads to the Dashboard for that site.' ) . '</li>' .
36-
'<li>' . __( 'Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.' ) . '</li>' .
37-
'<li>' . __( 'Delete which is a permanent action after the confirmation screen.' ) . '</li>' .
36+
'<li>' . __( 'Flag for Deletion, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.' ) . '</li>' .
37+
'<li>' . __( 'Delete Permanently which is a permanent action after the confirmation screen.' ) . '</li>' .
3838
'<li>' . __( 'Visit to go to the front-end of the live site.' ) . '</li></ul>',
3939
)
4040
);
@@ -61,9 +61,9 @@
6161
// A list of valid actions and their associated messaging for confirmation output.
6262
$manage_actions = array(
6363
/* translators: %s: Site URL. */
64-
'activateblog' => __( 'You are about to activate the site %s.' ),
64+
'activateblog' => __( 'You are about to remove the deletion flag from the site %s.' ),
6565
/* translators: %s: Site URL. */
66-
'deactivateblog' => __( 'You are about to deactivate the site %s.' ),
66+
'deactivateblog' => __( 'You are about to flag the site %s for deletion.' ),
6767
/* translators: %s: Site URL. */
6868
'unarchiveblog' => __( 'You are about to unarchive the site %s.' ),
6969
/* translators: %s: Site URL. */
@@ -106,6 +106,7 @@
106106

107107
$site_details = get_site( $id );
108108
$site_address = untrailingslashit( $site_details->domain . $site_details->path );
109+
$submit = __( 'Confirm' );
109110

110111
require_once ABSPATH . 'wp-admin/admin-header.php';
111112
?>
@@ -124,8 +125,18 @@
124125
<p><?php _e( 'Deleting a site is a permanent action that cannot be undone. This will delete the entire site and its uploads directory.' ); ?>
125126
</div>
126127
<?php
127-
} else {
128-
$submit = __( 'Confirm' );
128+
} elseif ( 'archiveblog' === $site_action ) {
129+
?>
130+
<div class="notice notice-warning inline">
131+
<p><?php _e( 'Archiving a site makes the site unavailable to its users and visitors. This is a reversible action.' ); ?>
132+
</div>
133+
<?php
134+
} elseif ( 'deactivateblog' === $site_action ) {
135+
?>
136+
<div class="notice notice-warning inline">
137+
<p><?php _e( 'Flagging a site for deletion makes the site unavailable to its users and visitors. This is a reversible action. A super admin can permanently delete the site at a later date.' ); ?>
138+
</div>
139+
<?php
129140
}
130141
?>
131142
<p><?php printf( $manage_actions[ $site_action ], "<strong>{$site_address}</strong>" ); ?></p>
@@ -205,6 +216,9 @@
205216
<input type="hidden" name="action" value="delete_sites" />
206217
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
207218
<?php wp_nonce_field( 'ms-delete-sites', '_wpnonce', false ); ?>
219+
<div class="notice notice-warning inline">
220+
<p><?php _e( 'Deleting a site is a permanent action that cannot be undone. This will delete the entire site and its uploads directory.' ); ?>
221+
</div>
208222
<p><?php _e( 'You are about to delete the following sites:' ); ?></p>
209223
<ul class="ul-disc">
210224
<?php
@@ -220,7 +234,7 @@
220234
</li>
221235
<?php endforeach; ?>
222236
</ul>
223-
<?php submit_button( __( 'Confirm' ), 'primary' ); ?>
237+
<?php submit_button( __( 'Delete these sites permanently' ), 'primary' ); ?>
224238
</form>
225239
</div>
226240
<?php
@@ -271,22 +285,22 @@
271285
update_blog_status( $id, 'deleted', '0' );
272286

273287
/**
274-
* Fires after a network site is activated.
288+
* Fires after a network site has its deletion flag removed.
275289
*
276290
* @since MU (3.0.0)
277291
*
278-
* @param int $id The ID of the activated site.
292+
* @param int $id The ID of the reactivated site.
279293
*/
280294
do_action( 'activate_blog', $id );
281295
break;
282296

283297
case 'deactivateblog':
284298
/**
285-
* Fires before a network site is deactivated.
299+
* Fires before a network site is flagged for deletion.
286300
*
287301
* @since MU (3.0.0)
288302
*
289-
* @param int $id The ID of the site being deactivated.
303+
* @param int $id The ID of the site being flagged for deletion.
290304
*/
291305
do_action( 'deactivate_blog', $id );
292306

@@ -326,10 +340,10 @@
326340
$msg = __( 'Sites marked as spam.' );
327341
break;
328342
case 'all_delete':
329-
$msg = __( 'Sites deleted.' );
343+
$msg = __( 'Sites permanently deleted.' );
330344
break;
331345
case 'delete':
332-
$msg = __( 'Site deleted.' );
346+
$msg = __( 'Site permanently deleted.' );
333347
break;
334348
case 'not_deleted':
335349
$msg = __( 'Sorry, you are not allowed to delete that site.' );
@@ -341,10 +355,10 @@
341355
$msg = __( 'Site unarchived.' );
342356
break;
343357
case 'activateblog':
344-
$msg = __( 'Site activated.' );
358+
$msg = __( 'Site deletion flag removed.' );
345359
break;
346360
case 'deactivateblog':
347-
$msg = __( 'Site deactivated.' );
361+
$msg = __( 'Site flagged for deletion.' );
348362
break;
349363
case 'unspamblog':
350364
$msg = __( 'Site removed from spam.' );

src/wp-includes/class-wp-site.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ final class WP_Site {
126126
public $spam = '0';
127127

128128
/**
129-
* Whether the site should be treated as deleted.
129+
* Whether the site should be treated as flagged for deletion.
130130
*
131131
* A numeric string, for compatibility reasons.
132132
*

src/wp-includes/ms-site.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ function wp_maybe_transition_site_statuses_on_update( $new_site, $old_site = nul
12431243
if ( '1' === $new_site->deleted ) {
12441244

12451245
/**
1246-
* Fires when the 'deleted' status is added to a site.
1246+
* Fires when the 'flagged for deletion' status is added to a site.
12471247
*
12481248
* @since 3.5.0
12491249
*
@@ -1253,7 +1253,7 @@ function wp_maybe_transition_site_statuses_on_update( $new_site, $old_site = nul
12531253
} else {
12541254

12551255
/**
1256-
* Fires when the 'deleted' status is removed from a site.
1256+
* Fires when the 'flagged for deletion' status is removed from a site.
12571257
*
12581258
* @since 3.5.0
12591259
*

src/wp-includes/user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ function get_blogs_of_user( $user_id, $all = false ) {
11261126
* @param object[] $sites An array of site objects belonging to the user.
11271127
* @param int $user_id User ID.
11281128
* @param bool $all Whether the returned sites array should contain all sites, including
1129-
* those marked 'deleted', 'archived', or 'spam'. Default false.
1129+
* those flagged for deletion, archived, or marked as spam.
11301130
*/
11311131
return apply_filters( 'get_blogs_of_user', $sites, $user_id, $all );
11321132
}

0 commit comments

Comments
 (0)