Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -118,7 +118,7 @@ class WP_REST_Themes_Controller extends WP_REST_Controller {
|
||||
* @since 5.7.0
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error True if the request has read access for the item, otherwise WP_Error object.
|
||||
* @return true|WP_Error True if the request has read access for the item, otherwise WP_Error object.
|
||||
*/
|
||||
public function get_item_permissions_check( $request ) {
|
||||
if ( current_user_can( 'switch_themes' ) || current_user_can( 'manage_network_themes' ) ) {
|
||||
@@ -144,7 +144,7 @@ class WP_REST_Themes_Controller extends WP_REST_Controller {
|
||||
*
|
||||
* @since 5.7.0
|
||||
*
|
||||
* @return bool|WP_Error Whether the theme can be read.
|
||||
* @return true|WP_Error True if the theme can be read, WP_Error object otherwise.
|
||||
*/
|
||||
protected function check_read_active_theme_permission() {
|
||||
if ( current_user_can( 'edit_posts' ) ) {
|
||||
@@ -231,9 +231,10 @@ class WP_REST_Themes_Controller extends WP_REST_Controller {
|
||||
*/
|
||||
public function prepare_item_for_response( $item, $request ) {
|
||||
// Restores the more descriptive, specific name for use within this method.
|
||||
$theme = $item;
|
||||
$data = array();
|
||||
$theme = $item;
|
||||
|
||||
$fields = $this->get_fields_for_response( $request );
|
||||
$data = array();
|
||||
|
||||
if ( rest_is_field_included( 'stylesheet', $fields ) ) {
|
||||
$data['stylesheet'] = $theme->get_stylesheet();
|
||||
|
||||
Reference in New Issue
Block a user