mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@53129 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -8440,3 +8440,21 @@ function is_php_version_compatible( $required ) {
|
||||
function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) {
|
||||
return abs( (float) $expected - (float) $actual ) <= $precision;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the keys of an array alphabetically.
|
||||
* The array is passed by reference so it doesn't get returned
|
||||
* which mimics the behaviour of ksort.
|
||||
*
|
||||
* @since 6.0.0
|
||||
*
|
||||
* @param array $array The array to sort, passed by reference.
|
||||
*/
|
||||
function wp_recursive_ksort( &$array ) {
|
||||
foreach ( $array as &$value ) {
|
||||
if ( is_array( $value ) ) {
|
||||
wp_recursive_ksort( $value );
|
||||
}
|
||||
}
|
||||
ksort( $array );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user