Assets/Script.php
public function register()
    {
        wp_register_script(
            $this->handle,
            $this->url,
            $this->dependencies,
            $this->version,
            $this->footer
        );

        // Localize the script as needed
        if( !empty( $this->localize['data'] ) && !empty( $this->localize['data'] ) ) {
            wp_localize_script(
                $this->handle,
                $this->localize['name'],
                $this->localize['data']
            );
        }
        $this->is_registered = true;
    }
public function register()
    {
        wp_register_script(
            $this->handle,
            $this->url,
            $this->dependencies,
            $this->version,
            $this->footer
        );

        // Localize the script as needed
        if( !empty( $this->localize['data'] ) && !empty( $this->localize['data'] ) ) {
            wp_localize_script(
                $this->handle,
                $this->localize['name'],
                $this->localize['data']
            );
        }
        $this->is_registered = true;
    }
public function register ( ) { wp_register_script ( $ this -> handle , $ this -> url , $ this -> dependencies , $ this -> version , $ this -> footer ) ; // Localize the script as needed if ( ! empty ( $ this -> localize [ 'data' ] ) && ! empty ( $ this -> localize [ 'data' ] ) ) { wp_localize_script ( $ this -> handle , $ this -> localize [ 'name' ] , $ this -> localize [ 'data' ] ) ; } $ this -> is_registered = true ; }
Enqueue the script and localize the data as needed
Enqueue the script and localize the data as needed