Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/wp-admin/theme-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

if ( ! current_user_can( 'edit_themes' ) ) {
wp_die( '<p>' . __( 'Sorry, you are not allowed to edit templates for this site.' ) . '</p>' );
wp_die( '<p>' . __( 'Sorry, you are not allowed to edit templates for this site.' ) . '</p>', 403 );
}

// Used in the HTML title tag.
Expand Down Expand Up @@ -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() ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/theme-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand All @@ -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' );
Expand Down
Loading