Skip to content

Commit 3b2ab1f

Browse files
Sort option fields in tabs after filters are applied
1 parent 6c0d915 commit 3b2ab1f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

classes/class-wp-stream-settings.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,20 +288,20 @@ public static function get_fields() {
288288
array_push( $fields['advanced']['fields'], $akismet_tracking );
289289
}
290290

291-
// Sort option fields in each tab by title ASC
292-
foreach ( $fields as $tab => $options ) {
293-
$titles = wp_list_pluck( $fields[ $tab ]['fields'], 'title' );
294-
295-
array_multisort( $titles, SORT_ASC, $fields[ $tab ]['fields'] );
296-
}
297-
298291
/**
299292
* Filter allows for modification of options fields
300293
*
301294
* @return array Array of option fields
302295
*/
303296
self::$fields = apply_filters( 'wp_stream_settings_option_fields', $fields );
304297

298+
// Sort option fields in each tab by title ASC
299+
foreach ( self::$fields as $tab => $options ) {
300+
$titles = wp_list_pluck( self::$fields[ $tab ]['fields'], 'title' );
301+
302+
array_multisort( $titles, SORT_ASC, self::$fields[ $tab ]['fields'] );
303+
}
304+
305305
return self::$fields;
306306
}
307307

0 commit comments

Comments
 (0)