get_unaliased_deps example


    private function get_unaliased_deps( array $deps ) {
        $flattened = array();
        foreach ( $deps as $dep ) {
            if ( ! isset( $this->registered[ $dep ] ) ) {
                continue;
            }

            if ( $this->registered[ $dep ]->src ) {
                $flattened[] = $dep;
            } elseif ( $this->registered[ $dep ]->deps ) {
                array_push( $flattened, ...$this->get_unaliased_deps( $this->registered[ $dep ]->deps ) );
            }
        }
        return $flattened;
    }

    /** * Gets tags for inline scripts registered for a specific handle. * * @since 6.3.0 * * @param string $handle Name of the script to get associated inline script tag for. * Must be lowercase. * @param string $position Optional. Whether to get tag for inline * scripts in the before or after position. Default 'after'. * @return string Inline script, which may be empty string. */
Home | Imprint | This part of the site doesn't use cookies.