Make WordPress Core


Ignore:
Timestamp:
04/11/2022 10:36:02 AM (5 years ago)
Author:
gziolo
Message:

Editor: Add functionality required for theme export in the site editor

This bring across changes to theme export functionality, and related code, and tests. Relates issue in Gutenberg: ​https://github.com/WordPress/gutenberg/issues/39889.

Props scruffian, timothyblynjacobs, oandregal, ajlende, zieleadam.
See #55505.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r53118 r53129  
    84418441        return abs( (float) $expected - (float) $actual ) <= $precision;
    84428442}
     8443
     8444/**
     8445 * Sorts the keys of an array alphabetically.
     8446 * The array is passed by reference so it doesn't get returned
     8447 * which mimics the behaviour of ksort.
     8448 *
     8449 * @since 6.0.0
     8450 *
     8451 * @param array $array The array to sort, passed by reference.
     8452 */
     8453function wp_recursive_ksort( &$array ) {
     8454        foreach ( $array as &$value ) {
     8455                if ( is_array( $value ) ) {
     8456                        wp_recursive_ksort( $value );
     8457                }
     8458        }
     8459        ksort( $array );
     8460}
Note: See TracChangeset for help on using the changeset viewer.