AnsPress_Syntax_Highlighter::output_scripts()
Description #
Output required scripts in footer.
Source #
File: addons/free/syntaxhighlighter.php
public static function output_scripts() { if ( ! is_anspress() ) { return; } global $wp_styles; $scripts = []; foreach ( self::$brushes as $brush => $label ) { $scripts[] = 'syntaxhighlighter-brush-' . strtolower( $brush ); } wp_print_scripts( $scripts ); if ( ! is_a( $wp_styles, 'WP_Styles' ) ) { $wp_styles = new WP_Styles(); } $sh_css = ''; $theme_css = ''; if ( ! empty( $wp_styles ) && ! empty( $wp_styles->registered ) && ! empty( $wp_styles->registered['syntaxhighlighter-core'] ) && ! empty( $wp_styles->registered['syntaxhighlighter-core']->src ) ) { $sh_css = add_query_arg( 'ver', AP_VERSION, $wp_styles->registered['syntaxhighlighter-core']->src ); $theme_css = add_query_arg( 'ver', AP_VERSION, $wp_styles->registered['syntaxhighlighter-theme-default']->src ); } ?> <script type='text/javascript'> (function($){ SyntaxHighlighter.defaults.toolbar = false; $(document).ready(function(){ AnsPress.loadCSS('<?php echo esc_url( $sh_css ); ?>'); AnsPress.loadCSS('<?php echo esc_url( $theme_css ); ?>'); SyntaxHighlighter.highlight(); }); })(jQuery); </script> <?php }
Expand full source code Collapse full source code View on GitHub: addons/free/syntaxhighlighter.php:153
Add your comment