_print_scripts

Print scripts (internal use only).

Description

_print_scripts(); 

Usage

  1. if ( !function_exists( '_print_scripts' ) ) { 
  2. require_once ABSPATH . WPINC . '/script-loader.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = _print_scripts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/script-loader.php  
  1. function _print_scripts() { 
  2. global $wp_scripts, $compress_scripts; 
  3.  
  4. $zip = $compress_scripts ? 1 : 0; 
  5. if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP ) 
  6. $zip = 'gzip'; 
  7.  
  8. if ( $concat = trim( $wp_scripts->concat, ', ' ) ) { 
  9.  
  10. if ( !empty($wp_scripts->print_code) ) { 
  11. echo "\n<script type='text/javascript'>\n"; 
  12. echo "/* <![CDATA[ */\n"; // not needed in HTML 5 
  13. echo $wp_scripts->print_code; 
  14. echo "/* ]]> */\n"; 
  15. echo "</script>\n"; 
  16.  
  17. $concat = str_split( $concat, 128 ); 
  18. $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat ); 
  19.  
  20. $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&" . $concat . '&ver=' . $wp_scripts->default_version; 
  21. echo "<script type='text/javascript' src='" . esc_attr($src) . "'></script>\n"; 
  22.  
  23. if ( !empty($wp_scripts->print_html) ) 
  24. echo $wp_scripts->print_html;