mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-14 04:06:36 +09:00
- fixed scroll via enqueue new scroll library;
- fixed order by Display name option
This commit is contained in:
@@ -328,5 +328,26 @@ if ( ! class_exists( 'UM_Functions' ) ) {
|
||||
$cpt = apply_filters( 'um_cpt_list', array( 'um_form', 'um_directory' ) );
|
||||
return $cpt;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param string $key
|
||||
* @param array $insert_array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function array_insert_before( $array, $key, $insert_array ) {
|
||||
$index = array_search( $key, array_keys( $array ) );
|
||||
if ( $index === false ) {
|
||||
return $array;
|
||||
}
|
||||
|
||||
$array = array_slice( $array, 0, $index, true ) +
|
||||
$insert_array +
|
||||
array_slice( $array, $index, count( $array ) - 1, true );
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user