GC_Dependencies::enqueue()
最后更新于:2021-11-27 14:23:05
GC_Dependencies::enqueue( string|string[]$handles)Queue an item or items.
参数
- $handles
-
(string|string[]) (Required) Item handle (string) or item handles (array of strings).
源文件
文件: gc-includes/class.gc-dependencies.php
public function enqueue( $handles ) {
foreach ( (array) $handles as $handle ) {
$handle = explode( '?', $handle );
if ( ! in_array( $handle[0], $this->queue, true ) && isset( $this->registered[ $handle[0] ] ) ) {
$this->queue[] = $handle[0];
// Reset all dependencies so they must be recalculated in recurse_deps().
$this->all_queued_deps = null;
if ( isset( $handle[1] ) ) {
$this->args[ $handle[0] ] = $handle[1];
}
}
}
}