GC_Dependencies::do_items()
最后更新于:2021-11-27 14:20:23
GC_Dependencies::do_items( string|string[]|false$handles=false, int|false$group=false)Processes the items and dependencies.
参数
- $handles
-
(string|string[]|false) (Optional) Items to be processed: queue (false), single item (string), or multiple items (array of strings).
Default value: false
- $group
-
(int|false) (Optional) Group level: level (int), no groups (false).
Default value: false
响应
(string[]) Array of handles of items that have been processed.
源文件
文件: gc-includes/class.gc-dependencies.php
public function do_items( $handles = false, $group = false ) {
/*
* If nothing is passed, print the queue. If a string is passed,
* print that item. If an array is passed, print those items.
*/
$handles = false === $handles ? $this->queue : (array) $handles;
$this->all_deps( $handles );
foreach ( $this->to_do as $key => $handle ) {
if ( ! in_array( $handle, $this->done, true ) && isset( $this->registered[ $handle ] ) ) {
/*
* Attempt to process the item. If successful,
* add the handle to the done array.
*
* Unset the item from the to_do array.
*/
if ( $this->do_item( $handle, $group ) ) {
$this->done[] = $handle;
}
unset( $this->to_do[ $key ] );
}
}
return $this->done;
}