src/Assets/Register.php
protected function enqueue_script( $script, $hook = null ) {
		if ( $script['condition']( $hook ) ) {
			wp_enqueue_script(
				$script['handle'],
				$this->url . $script['src'] . $this->min . '.js',
				isset( $script['deps'] ) ? $script['deps'] : array(),
				$this->version,
				isset( $script['footer'] ) ? $script['footer'] : false
			);

			if ( isset( $script['localize'] ) ) {
				if ( is_callable( $script['localize'] ) ) { // @todo make all properties callables
					$script['localize'] = call_user_func( $script['localize'] );
				}

				wp_localize_script(
					$script['handle'],
					$script['localize']['name'],
					$script['localize']['data']
				);
			}
		}
	}
protected function enqueue_script( $script, $hook = null ) {
		if ( $script['condition']( $hook ) ) {
			wp_enqueue_script(
				$script['handle'],
				$this->url . $script['src'] . $this->min . '.js',
				isset( $script['deps'] ) ? $script['deps'] : array(),
				$this->version,
				isset( $script['footer'] ) ? $script['footer'] : false
			);

			if ( isset( $script['localize'] ) ) {
				if ( is_callable( $script['localize'] ) ) { // @todo make all properties callables
					$script['localize'] = call_user_func( $script['localize'] );
				}

				wp_localize_script(
					$script['handle'],
					$script['localize']['name'],
					$script['localize']['data']
				);
			}
		}
	}
protected function enqueue_script ( $ script , $ hook = null ) { if ( $ script [ 'condition' ] ( $ hook ) ) { wp_enqueue_script ( $ script [ 'handle' ] , $ this -> url . $ script [ 'src' ] . $ this -> min . '.js' , isset ( $ script [ 'deps' ] ) ? $ script [ 'deps' ] : array ( ) , $ this -> version , isset ( $ script [ 'footer' ] ) ? $ script [ 'footer' ] : false ) ; if ( isset ( $ script [ 'localize' ] ) ) { if ( is_callable ( $ script [ 'localize' ] ) ) { // @todo make all properties callables $ script [ 'localize' ] = call_user_func ( $ script [ 'localize' ] ) ; } wp_localize_script ( $ script [ 'handle' ] , $ script [ 'localize' ] [ 'name' ] , $ script [ 'localize' ] [ 'data' ] ) ; } } }
Enqueues an individual script if the style's condition is met.

@param array  $script The script attachment callback.
@param string $hook   The location hook. Only passed on admin side.
Enqueues an individual script if the style s condition is met .