wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_recursive_ksort › WordPress Function

Since6.0.0
已弃用n/a
wp_recursive_ksort ( $input_array )
参数:
  • (array) $input_array The array to sort, passed by reference.
    Required: Yes
定义在:
文档:

Sorts the keys of an array alphabetically.

The array is passed by reference so it doesn't get returned which mimics the behavior of ksort().


源码

function wp_recursive_ksort( &$input_array ) {
	foreach ( $input_array as &$value ) {
		if ( is_array( $value ) ) {
			wp_recursive_ksort( $value );
		}
	}

	ksort( $input_array );
}