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:
Tony Volpe
2023-12-05 23:05:59 +00:00
parent ba16964e7a
commit 725d3043d5
1463 changed files with 142461 additions and 89421 deletions

View File

@@ -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();