Changeset 10367
- Timestamp:
- 01/15/2009 07:50:23 PM (16 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class.wp-scripts.php
r10362 r10367 27 27 var $print_html = ''; 28 28 var $print_code = ''; 29 var $src = ''; 29 30 var $default_dirs; 30 31 … … 110 111 } 111 112 113 $this->src .= "$src,"; 112 114 $src = add_query_arg('ver', $ver, $src); 113 115 $src = clean_url(apply_filters( 'script_loader_src', $src, $handle )); -
trunk/wp-includes/functions.wp-scripts.php
r9243 r10367 41 41 * @see WP_Scripts::add() For parameter information. 42 42 */ 43 function wp_register_script( $handle, $src, $deps = array(), $ver = false ) {43 function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) { 44 44 global $wp_scripts; 45 45 if ( !is_a($wp_scripts, 'WP_Scripts') ) … … 47 47 48 48 $wp_scripts->add( $handle, $src, $deps, $ver ); 49 if ( $in_footer ) 50 $wp_scripts->add_data( $handle, 'group', 1 ); 49 51 } 50 52 … … 87 89 * @see WP_Script::add(), WP_Script::enqueue() 88 90 */ 89 function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false ) {91 function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) { 90 92 global $wp_scripts; 91 93 if ( !is_a($wp_scripts, 'WP_Scripts') ) … … 95 97 $_handle = explode('?', $handle); 96 98 $wp_scripts->add( $_handle[0], $src, $deps, $ver ); 99 if ( $in_footer ) 100 $wp_scripts->add_data( $_handle[0], 'group', 1 ); 97 101 } 98 102 $wp_scripts->enqueue( $handle ); -
trunk/wp-includes/script-loader.php
r10366 r10367 537 537 function wp_print_head_scripts() { 538 538 do_action( 'wp_print_scripts' ); 539 global $wp_scripts, $concatenate_scripts , $compress_scripts;539 global $wp_scripts, $concatenate_scripts; 540 540 541 541 if ( !is_a($wp_scripts, 'WP_Scripts') ) … … 548 548 $wp_scripts->do_head_items(); 549 549 550 _pring_scripts(); 550 if ( apply_filters('print_head_scripts', true) ) 551 _pring_scripts(); 551 552 552 553 $wp_scripts->do_concat = false; 554 $wp_scripts->print_code = $wp_scripts->concat = $wp_scripts->concat_version = $wp_scripts->print_html = $wp_scripts->src = ''; 553 555 return $wp_scripts->done; 554 556 } … … 571 573 $wp_scripts->do_footer_items(); 572 574 573 _pring_scripts(); 575 if ( apply_filters('print_footer_scripts', true) ) 576 _pring_scripts(); 574 577 575 578 $wp_scripts->do_concat = false; 579 $wp_scripts->concat = $wp_scripts->concat_version = $wp_scripts->print_code = $wp_scripts->print_html = $wp_scripts->src = ''; 576 580 return $wp_scripts->done; 577 581 } … … 590 594 echo "/* ]]> */\n"; 591 595 echo "</script>\n"; 592 $wp_scripts->print_code = '';593 596 } 594 597 595 $ver = md5( $wp_scripts->concat_version);596 $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}& load=" . rtrim($wp_scripts->concat, ',') . "&ver=$ver";598 $ver = md5("$wp_scripts->concat" . "$wp_scripts->concat_version"); 599 $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&load=" . rtrim($wp_scripts->concat, ',') . "&ver=$ver"; 597 600 echo "<script type='text/javascript' src='$src'></script>\n"; 598 $wp_scripts->concat = $wp_scripts->concat_version = '';599 601 } 600 602 601 if ( !empty($wp_scripts->print_html) ) {603 if ( !empty($wp_scripts->print_html) ) 602 604 echo $wp_scripts->print_html; 603 $wp_scripts->print_html = ''; 604 } 605 605 606 } 606 607 … … 619 620 $wp_styles->do_items(false); 620 621 621 if ( !empty($wp_styles->concat) ) { 622 $ver = md5($wp_styles->concat_version); 623 $rtl = 'rtl' === $wp_styles->text_direction ? 1 : 0; 624 $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&rtl={$rtl}&load=" . rtrim($wp_styles->concat, ',') . "&ver=$ver"; 625 echo "<link rel='stylesheet' href='$href' type='text/css' media='all' />\n"; 626 $wp_styles->concat = $wp_styles->concat_version = ''; 622 if ( apply_filters('print_admin_styles', true) ) { 623 if ( !empty($wp_styles->concat) ) { 624 $ver = md5("$wp_styles->concat" . "$wp_styles->concat_version"); 625 $rtl = 'rtl' === $wp_styles->text_direction ? 1 : 0; 626 $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&rtl={$rtl}&load=" . rtrim($wp_styles->concat, ',') . "&ver=$ver"; 627 echo "<link rel='stylesheet' href='$href' type='text/css' media='all' />\n"; 628 } 629 630 if ( !empty($wp_styles->print_html) ) 631 echo $wp_styles->print_html; 627 632 } 628 633 629 if ( !empty($wp_styles->print_html) ) {630 echo $wp_styles->print_html;631 $wp_styles->print_html = '';632 }633 634 634 $wp_styles->do_concat = false; 635 $wp_styles->concat = $wp_styles->concat_version = $wp_styles->print_html = ''; 635 636 return $wp_styles->done; 636 637 }
Note: See TracChangeset
for help on using the changeset viewer.