Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#64636 closed enhancement (fixed)

WP_Theme_JSON: Remove unnecessary array check for value return

Reported by: soean's profile Soean Owned by: westonruter's profile westonruter
Milestone: 7.0 Priority: normal
Severity: normal Version: 6.3
Component: Editor Keywords: has-patch commit
Focuses: Cc:

Description

We should remove the unnecessary array check for value return at the end of the get_property_value() method in WP_Theme_JSON.

<?php
        if ( is_array( $value ) ) {
                return $value;
        }

        return $value;
}

This is a backport of https://github.com/WordPress/gutenberg/pull/75515

Change History (6)

This ticket was mentioned in PR #10928 on WordPress/wordpress-develop by @Soean.


2 months ago
#1

  • Keywords has-patch added

#2 @mukesh27
2 months ago

  • Component changed from General to Editor
  • Keywords commit added
  • Milestone changed from Awaiting Review to 7.0
  • Type changed from defect (bug) to enhancement

#3 @westonruter
2 months ago

  • Owner set to westonruter
  • Status changed from new to reviewing

@westonruter commented on PR #10928:


2 months ago
#4

This issue was introduced in https://github.com/WordPress/gutenberg/commit/ccd529d7a6af as part of https://github.com/WordPress/gutenberg/pull/50366. (Props Gemini for locating that.)

#5 @westonruter
2 months ago

  • Version set to 6.3

#6 @westonruter
2 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 61640:

Code Quality: Remove unnecessary array check for value return in WP_Theme_JSON::get_property_value().

Developed in https://github.com/WordPress/wordpress-develop/pull/10928

Follow-up to https://github.com/WordPress/gutenberg/commit/ccd529d7a6af

Props soean, mukesh27, westonruter.
Fixes #64636.

Note: See TracTickets for help on using tickets.