Sorts the given script module identifiers based on their dependencies.
Description
It will return a list of script module identifiers sorted in the order they should be printed, so that dependencies are printed before the script modules that depend on them.
Parameters
$idsstring[]required- The identifiers of the script modules to sort.
$import_typesstring[]optional- Import types of dependencies to retrieve:
'static','dynamic', or both.
Default is both.Default:
array(, )
Source
private function get_sorted_dependencies( array $ids, array $import_types = array( 'static', 'dynamic' ) ): array {
$sorted = array();
foreach ( $ids as $id ) {
$this->sort_item_dependencies( $id, $import_types, $sorted );
}
return array_unique( $sorted );
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.