Changeset 56345
- Timestamp:
- 08/01/2023 08:29:47 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r56181 r56345 546 546 $class_name = ''; 547 547 548 /* 549 * TODO: Replace array_key_exists() with isset() check once WordPress drops 550 * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067. 551 */ 552 if ( array_key_exists( $element, static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES ) ) { 548 if ( isset( static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $element ] ) ) { 553 549 $class_name = static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $element ]; 554 550 } … … 741 737 $schema_styles_elements[ $element ] = $styles_non_top_level; 742 738 743 /* 744 * TODO: Replace array_key_exists() with isset() check once WordPress drops 745 * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067. 746 */ 747 if ( array_key_exists( $element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) { 739 if ( isset( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] ) ) { 748 740 foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) { 749 741 $schema_styles_elements[ $element ][ $pseudo_selector ] = $styles_non_top_level; … … 1929 1921 $path_string = implode( '.', $value_path ); 1930 1922 if ( 1931 /* 1932 * TODO: Replace array_key_exists() with isset() check once WordPress drops 1933 * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067. 1934 */ 1935 array_key_exists( $path_string, static::PROTECTED_PROPERTIES ) && 1923 isset( static::PROTECTED_PROPERTIES[ $path_string ] ) && 1936 1924 _wp_array_get( $settings, static::PROTECTED_PROPERTIES[ $path_string ], null ) === null 1937 1925 ) { … … 2137 2125 ); 2138 2126 2139 /* 2140 * Handle any pseudo selectors for the element. 2141 * TODO: Replace array_key_exists() with isset() check once WordPress drops 2142 * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067. 2143 */ 2144 if ( array_key_exists( $element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) { 2127 // Handle any pseudo selectors for the element. 2128 if ( isset( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] ) ) { 2145 2129 foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) { 2146 2130 … … 2291 2275 ); 2292 2276 2293 /* 2294 * Handle any pseudo selectors for the element. 2295 * TODO: Replace array_key_exists() with isset() check once WordPress drops 2296 * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067. 2297 */ 2298 if ( array_key_exists( $element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) { 2277 // Handle any pseudo selectors for the element. 2278 if ( isset( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] ) ) { 2299 2279 foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) { 2300 2280 if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'][ $element ][ $pseudo_selector ] ) ) { … … 2374 2354 $element_pseudo_allowed = array(); 2375 2355 2376 /* 2377 * TODO: Replace array_key_exists() with isset() check once WordPress drops 2378 * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067. 2379 */ 2380 if ( array_key_exists( $current_element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) { 2356 if ( isset( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ] ) ) { 2381 2357 $element_pseudo_allowed = static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ]; 2382 2358 } … … 2403 2379 */ 2404 2380 if ( $pseudo_selector && isset( $node[ $pseudo_selector ] ) && 2405 /* 2406 * TODO: Replace array_key_exists() with isset() check once WordPress drops 2407 * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067. 2408 */ 2409 array_key_exists( $current_element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) 2381 isset( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ] ) 2410 2382 && in_array( $pseudo_selector, static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ], true ) 2411 2383 ) { … … 2896 2868 * $output is stripped of pseudo selectors. Re-add and process them 2897 2869 * or insecure styles here. 2898 *2899 * TODO: Replace array_key_exists() with isset() check once WordPress drops2900 * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.2901 2870 */ 2902 if ( array_key_exists( $current_element, static::VALID_ELEMENT_PSEUDO_SELECTORS) ) {2871 if ( isset( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ] ) ) { 2903 2872 foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ] as $pseudo_selector ) { 2904 2873 if ( isset( $input[ $pseudo_selector ] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.