protected function maybe_localize( $dependency, $context ) {
		if ( ! array_key_exists( 'localize', $dependency ) ) {
			return;
		}

		$localize = $dependency['localize'];
		$data     = $localize['data'];
		if ( is_callable( $data ) ) {
			$data = $data( $context );
		}

		wp_localize_script( $dependency['handle'], $localize['name'], $data );
	}
protected function maybe_localize( $dependency, $context ) {
		if ( ! array_key_exists( 'localize', $dependency ) ) {
			return;
		}

		$localize = $dependency['localize'];
		$data     = $localize['data'];
		if ( is_callable( $data ) ) {
			$data = $data( $context );
		}

		wp_localize_script( $dependency['handle'], $localize['name'], $data );
	}
protected function maybe_localize ( $ dependency , $ context ) { if ( ! array_key_exists ( 'localize' , $ dependency ) ) { return ; } $ localize = $ dependency [ 'localize' ] ; $ data = $ localize [ 'data' ] ; if ( is_callable ( $ data ) ) { $ data = $ data ( $ context ) ; } wp_localize_script ( $ dependency [ 'handle' ] , $ localize [ 'name' ] , $ data ) ; }
Localize the script of a given dependency.

@since 0.1.0

@param array $dependency The dependency to localize the script of.
@param mixed $context    Contextual data to pass to the callback.
Contains the type of the dependency at key
'dependency_type'.
Localize the script of a given dependency .