Changeset 11536
- Timestamp:
- 02/10/2022 12:57:43 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/class-plugins-info-api-request.php
r11535 r11536 118 118 ); 119 119 120 // Fields that affect other fields. 121 // If the key is disabled, disable all of the values here unless client turns them on. 122 static $field_interconnected = array( 123 'sections' => [ 'reviews' ], // If sections is disabled, reviews should be disabled unless explicit. 124 ); 125 120 126 public function __construct( $args ) { 121 127 $args = (object) $args; … … 203 209 $field = self::$field_aliases[ $field ] ?? $field; 204 210 211 // Disable linked fields if required. 212 if ( ! $include && isset( self::$field_interconnected[ $field ] ) ) { 213 foreach ( self::$field_interconnected[ $field ] as $linked_field ) { 214 if ( ! isset( $fields[ $linked_field ] ) ) { 215 $requested_fields[ $linked_field ] = false; 216 } 217 } 218 } 219 205 220 // If it's a valid field, include it. 206 221 if ( isset( self::$fields[ $field ] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.