diff --git a/src/wp-admin/theme-editor.php b/src/wp-admin/theme-editor.php index e7fd3fa88b8e5..6715f4a9b6ca7 100644 --- a/src/wp-admin/theme-editor.php +++ b/src/wp-admin/theme-editor.php @@ -15,7 +15,7 @@ } if ( ! current_user_can( 'edit_themes' ) ) { - wp_die( '

' . __( 'Sorry, you are not allowed to edit templates for this site.' ) . '

' ); + wp_die( '

' . __( 'Sorry, you are not allowed to edit templates for this site.' ) . '

', 403 ); } // Used in the HTML title tag. @@ -70,7 +70,7 @@ $theme = wp_get_theme( $stylesheet ); if ( ! $theme->exists() ) { - wp_die( __( 'The requested theme does not exist.' ) ); + wp_die( __( 'The requested theme does not exist.' ), 404 ); } if ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_code() ) { diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index e9d217c0f7525..1b245a2f0e15c 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -13,7 +13,7 @@ $tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : ''; if ( ! current_user_can( 'install_themes' ) ) { - wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); + wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ), 403 ); } if ( is_multisite() && ! is_network_admin() ) { diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index 08245a09718e0..ffa216e910516 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -83,7 +83,7 @@ exit; } elseif ( 'enable-auto-update' === $_GET['action'] ) { if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) { - wp_die( __( 'Sorry, you are not allowed to enable themes automatic updates.' ) ); + wp_die( __( 'Sorry, you are not allowed to enable themes automatic updates.' ), 403 ); } check_admin_referer( 'updates' ); @@ -103,7 +103,7 @@ exit; } elseif ( 'disable-auto-update' === $_GET['action'] ) { if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) { - wp_die( __( 'Sorry, you are not allowed to disable themes automatic updates.' ) ); + wp_die( __( 'Sorry, you are not allowed to disable themes automatic updates.' ), 403 ); } check_admin_referer( 'updates' );