Automattic\WooCommerce\Blocks
AssetsController::get_script_dependency_src_array()
Get the src of all script dependencies (handles).
Метод класса: AssetsController{}
Хуков нет.
Возвращает
Строку[]
. Array of src strings.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_script_dependency_src_array( $dependencies );
- $dependencies(массив) (обязательный)
- Array of dependency handles.
Код AssetsController::get_script_dependency_src_array() AssetsController::get script dependency src array WC 9.6.1
private function get_script_dependency_src_array( array $dependencies ) { $wp_scripts = wp_scripts(); return array_reduce( $dependencies, function ( $src, $handle ) use ( $wp_scripts ) { if ( isset( $wp_scripts->registered[ $handle ] ) ) { $src[] = esc_url( add_query_arg( 'ver', $wp_scripts->registered[ $handle ]->ver, $this->get_absolute_url( $wp_scripts->registered[ $handle ]->src ) ) ); $src = array_merge( $src, $this->get_script_dependency_src_array( $wp_scripts->registered[ $handle ]->deps ) ); } return $src; }, array() ); }