public function enqueueHighlightJsLibs($style = '', array $langs = ['wp'])
    {
        if (($data = $this->didEnqueueLibs(__METHOD__))) {
            return $data; // Did this already.
        } // We only need to enqueue once.

        if (isset($style)) {
            $style = $style ?: 'default';
        } else {
            $style = ''; // No style.
        }
        $data = []; // Initialize data array.

        if ($style) { // Loading a style?
            $data['styles'] = [
                'highlight-js' => $this->highlightJsStyleData($style),
            ];
        }
        $data['scripts'] = [
            'highlight-js' => [
                'version' => '9.12.0',
                'url'     => '//cdnjs.cloudflare.com/ajax/libs/highlight.js/%1$s/highlight.min.js',
            ],
        ];
        foreach ($langs as $_lang) {
            $data['scripts']['highlight-js-lang-'.$_lang] = $this->highlightJsLangData($_lang);
        } // unset($_lang); // Housekeeping.

        return $this->enqueueLibs(__METHOD__, $data);
    }
public function enqueueHighlightJsLibs($style = '', array $langs = ['wp'])
    {
        if (($data = $this->didEnqueueLibs(__METHOD__))) {
            return $data; // Did this already.
        } // We only need to enqueue once.

        if (isset($style)) {
            $style = $style ?: 'default';
        } else {
            $style = ''; // No style.
        }
        $data = []; // Initialize data array.

        if ($style) { // Loading a style?
            $data['styles'] = [
                'highlight-js' => $this->highlightJsStyleData($style),
            ];
        }
        $data['scripts'] = [
            'highlight-js' => [
                'version' => '9.12.0',
                'url'     => '//cdnjs.cloudflare.com/ajax/libs/highlight.js/%1$s/highlight.min.js',
            ],
        ];
        foreach ($langs as $_lang) {
            $data['scripts']['highlight-js-lang-'.$_lang] = $this->highlightJsLangData($_lang);
        } // unset($_lang); // Housekeeping.

        return $this->enqueueLibs(__METHOD__, $data);
    }
public function enqueueHighlightJsLibs ( $ style = '' , array $ langs = [ 'wp' ] ) { if ( ( $ data = $ this -> didEnqueueLibs ( __METHOD__ ) ) ) { return $ data ; // Did this already. } // We only need to enqueue once. if ( isset ( $ style ) ) { $ style = $ style ? : 'default' ; } else { $ style = '' ; // No style. } $ data = [ ] ; // Initialize data array. if ( $ style ) { // Loading a style? $ data [ 'styles' ] = [ 'highlight-js' => $ this -> highlightJsStyleData ( $ style ) , ] ; } $ data [ 'scripts' ] = [ 'highlight-js' => [ 'version' => '9.12.0' , 'url' => '//cdnjs.cloudflare.com/ajax/libs/highlight.js/%1$s/highlight.min.js' , ] , ] ; foreach ( $ langs as $ _lang ) { $ data [ 'scripts' ] [ 'highlight-js-lang-' . $ _lang ] = $ this -> highlightJsLangData ( $ _lang ) ; } // unset($_lang); // Housekeeping. return $ this -> enqueueLibs ( __METHOD__ , $ data ) ; }
Enqueue Highlight.js libs.

@since 170128.18158 Highlight.js libs.

@param string|null $style Highlight.js style.
@param array       $langs Highlight.js extra langs.

@return array Library details.
Enqueue Highlight . js libs .