From 2a0517b05f0ba2a30de1e8153836cdbf942b7c29 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Tue, 4 Mar 2025 06:05:15 +0000 Subject: [PATCH] Editor: Use the `export` cap to determine whether users can export themes. This changeset replaces `edit_theme_options` with the `export` capability to determine whether the current user can export themes. That condition determines whether to show the Export Theme button in the Site Editor. Using `export` capability makes it more consistent with general export capabilities across the administration. Props unsalkorkmaz, rajinsharwar, audrasjb, peterwilsoncc, desrosj, Mamaduka, TimothyBlynJacobs. Fixes #57379. git-svn-id: https://develop.svn.wordpress.org/trunk@59924 602fd350-edb4-49c9-b593-d223f7449a82 --- .../endpoints/class-wp-rest-edit-site-export-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php index d326782f15..297249497b 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php @@ -53,7 +53,7 @@ class WP_REST_Edit_Site_Export_Controller extends WP_REST_Controller { * @return true|WP_Error True if the request has access, or WP_Error object. */ public function permissions_check() { - if ( current_user_can( 'edit_theme_options' ) ) { + if ( current_user_can( 'export' ) ) { return true; }