X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3947bc013df7edd54b46deed8230d2eeafc5ecb..e3ff8f35458a959c1879c0a4976701ed8dcfe651:/wp-admin/network/site-themes.php diff --git a/wp-admin/network/site-themes.php b/wp-admin/network/site-themes.php index d48e2ca8..a500c533 100644 --- a/wp-admin/network/site-themes.php +++ b/wp-admin/network/site-themes.php @@ -10,11 +10,8 @@ /** Load WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); -if ( ! is_multisite() ) - wp_die( __( 'Multisite support is not enabled.' ) ); - if ( ! current_user_can( 'manage_sites' ) ) - wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) ); + wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) ); get_current_screen()->add_help_tab( array( 'id' => 'overview', @@ -29,8 +26,8 @@ get_current_screen()->add_help_tab( array( get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . - '

' . __('Documentation on Site Management') . '

' . - '

' . __('Support Forums') . '

' + '

' . __('Documentation on Site Management') . '

' . + '

' . __('Support Forums') . '

' ); get_current_screen()->set_screen_reader_content( array( @@ -61,13 +58,13 @@ if ( ! $id ) $wp_list_table->prepare_items(); -$details = get_blog_details( $id ); +$details = get_site( $id ); if ( ! $details ) { wp_die( __( 'The requested site does not exist.' ) ); } if ( !can_edit_network( $details->site_id ) ) - wp_die( __( 'You do not have permission to access this page.' ), 403 ); + wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); $is_main_site = is_main_site( $id ); @@ -122,6 +119,29 @@ if ( $action ) { $n = 'none'; } break; + default: + if ( isset( $_POST['checked'] ) ) { + check_admin_referer( 'bulk-themes' ); + $themes = (array) $_POST['checked']; + $n = count( $themes ); + /** + * Fires when a custom bulk action should be handled. + * + * The redirect link should be modified with success or failure feedback + * from the action to be used to display feedback to the user. + * + * @since 4.7.0 + * + * @param string $redirect_url The redirect URL. + * @param string $action The action being taken. + * @param array $items The items to take the action on. + * @param int $site_id The site id. + */ + $referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $themes, $id ); + } else { + $action = 'error'; + $n = 'none'; + } } update_option( 'allowedthemes', $allowed_themes ); @@ -139,6 +159,7 @@ if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { add_thickbox(); add_screen_option( 'per_page' ); +/* translators: %s: site name */ $title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); $parent_file = 'sites.php'; @@ -149,20 +170,12 @@ require( ABSPATH . 'wp-admin/admin-header.php' ); ?>

|

- $id, + 'selected' => 'site-themes' +) ); if ( isset( $_GET['enabled'] ) ) { $enabled = absint( $_GET['enabled'] );