WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

WP_Dependencies::all_deps() public WP 2.1.0

Determines dependencies.

Recursively builds an array of items to process taking dependencies into account. Does NOT catch infinite loops.

{} Это метод класса: WP_Dependencies{}

Хуков нет.

Возвращает

true/false. True on success, false on failure.

Использование

$WP_Dependencies = new WP_Dependencies();
$WP_Dependencies->all_deps( $handles, $recursion, $group );
$handles(строка/строка[]) (обязательный)
Item handle (string) or item handles (array of strings).
$recursion(true/false)
Internal flag that function is calling itself.
По умолчанию: false
$group(число/false)
Group level: level (int), no groups (false).
По умолчанию: false

Список изменений

С версии 2.1.0 Введена.
С версии 2.6.0 Moved from WP_Scripts.
С версии 2.8.0 Added the $group parameter.

Код WP_Dependencies::all_deps() WP 5.5.1

<?php
public function all_deps( $handles, $recursion = false, $group = false ) {
	$handles = (array) $handles;
	if ( ! $handles ) {
		return false;
	}

	foreach ( $handles as $handle ) {
		$handle_parts = explode( '?', $handle );
		$handle       = $handle_parts[0];
		$queued       = in_array( $handle, $this->to_do, true );

		if ( in_array( $handle, $this->done, true ) ) { // Already done.
			continue;
		}

		$moved     = $this->set_group( $handle, $recursion, $group );
		$new_group = $this->groups[ $handle ];

		if ( $queued && ! $moved ) { // Already queued and in the right group.
			continue;
		}

		$keep_going = true;
		if ( ! isset( $this->registered[ $handle ] ) ) {
			$keep_going = false; // Item doesn't exist.
		} elseif ( $this->registered[ $handle ]->deps && array_diff( $this->registered[ $handle ]->deps, array_keys( $this->registered ) ) ) {
			$keep_going = false; // Item requires dependencies that don't exist.
		} elseif ( $this->registered[ $handle ]->deps && ! $this->all_deps( $this->registered[ $handle ]->deps, true, $new_group ) ) {
			$keep_going = false; // Item requires dependencies that don't exist.
		}

		if ( ! $keep_going ) { // Either item or its dependencies don't exist.
			if ( $recursion ) {
				return false; // Abort this branch.
			} else {
				continue; // We're at the top level. Move on to the next one.
			}
		}

		if ( $queued ) { // Already grabbed it and its dependencies.
			continue;
		}

		if ( isset( $handle_parts[1] ) ) {
			$this->args[ $handle ] = $handle_parts[1];
		}

		$this->to_do[] = $handle;
	}

	return true;
}