Automattic\WooCommerce\Blocks
AssetsController::get_script_dependency_src_array
Get the src of all script dependencies (handles).
Method of the class: AssetsController{}
No Hooks.
Returns
String[]. Array of src strings.
Usage
// private - for code of main (parent) class only $result = $this->get_script_dependency_src_array( $dependencies );
- $dependencies(array) (required)
- Array of dependency handles.
AssetsController::get_script_dependency_src_array() AssetsController::get script dependency src array code WC 10.9.1
private function get_script_dependency_src_array( array $dependencies ) {
$wp_scripts = wp_scripts();
$found_dependencies = array();
$this->gather_script_dependency_handles( $dependencies, $wp_scripts, $found_dependencies );
$src = array();
foreach ( $found_dependencies as $handle => $unused ) {
$src[] = esc_url( add_query_arg( 'ver', $wp_scripts->registered[ $handle ]->ver, $this->get_absolute_url( $wp_scripts->registered[ $handle ]->src ) ) );
}
return $src;
}