src/Asset/Asset.php
protected function enqueueScript()
    {
        wp_enqueue_script(
            $this->getHandle(),
            $this->getUrl(),
            $this->getDependencies(),
            $this->getVersion(),
            $this->getArgument()
        );

        if (! empty($this->localize)) {
            foreach ($this->localize as $name => $data) {
                wp_localize_script($this->getHandle(), $name, $data);
            }
        }

        if (! empty($this->inline)) {
            foreach ($this->inline as $code) {
                wp_add_inline_script($this->getHandle(), $code['code'], $code['position']);
            }
        }
    }
protected function enqueueScript()
    {
        wp_enqueue_script(
            $this->getHandle(),
            $this->getUrl(),
            $this->getDependencies(),
            $this->getVersion(),
            $this->getArgument()
        );

        if (! empty($this->localize)) {
            foreach ($this->localize as $name => $data) {
                wp_localize_script($this->getHandle(), $name, $data);
            }
        }

        if (! empty($this->inline)) {
            foreach ($this->inline as $code) {
                wp_add_inline_script($this->getHandle(), $code['code'], $code['position']);
            }
        }
    }
protected function enqueueScript ( ) { wp_enqueue_script ( $ this -> getHandle ( ) , $ this -> getUrl ( ) , $ this -> getDependencies ( ) , $ this -> getVersion ( ) , $ this -> getArgument ( ) ) ; if ( ! empty ( $ this -> localize ) ) { foreach ( $ this -> localize as $ name => $ data ) { wp_localize_script ( $ this -> getHandle ( ) , $ name , $ data ) ; } } if ( ! empty ( $ this -> inline ) ) { foreach ( $ this -> inline as $ code ) { wp_add_inline_script ( $ this -> getHandle ( ) , $ code [ 'code' ] , $ code [ 'position' ] ) ; } } }
Enqueue a script asset.
Enqueue a script asset .