Changeset 12558
- Timestamp:
- 12/28/2009 12:48:20 AM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class.wp-dependencies.php
r12049 r12558 233 233 if ( !is_array($this->deps) ) 234 234 $this->deps = array(); 235 if ( !$this->ver )236 $this->ver = false;237 235 } 238 236 -
trunk/wp-includes/class.wp-scripts.php
r11383 r12558 91 91 $this->in_footer = array_diff( $this->in_footer, (array) $handle ); 92 92 93 $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; 93 if ( null === $this->registered[$handle]->ver ) 94 $ver = ''; 95 else 96 $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; 97 94 98 if ( isset($this->args[$handle]) ) 95 $ver .= '&' . $this->args[$handle];99 $ver = $ver ? $ver . '&' . $this->args[$handle] : '?' . $this->args[$handle]; 96 100 97 101 $src = $this->registered[$handle]->src; … … 115 119 } 116 120 117 $src = add_query_arg('ver', $ver, $src); 121 if ( !empty($ver) ) 122 $src = add_query_arg('ver', $ver, $src); 118 123 $src = esc_url(apply_filters( 'script_loader_src', $src, $handle )); 119 124 -
trunk/wp-includes/class.wp-styles.php
r11383 r12558 36 36 return false; 37 37 38 $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; 38 if ( null === $this->registered[$handle]->ver ) 39 $ver = ''; 40 else 41 $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; 42 39 43 if ( isset($this->args[$handle]) ) 40 $ver .= '&' . $this->args[$handle];44 $ver = $ver ? $ver . '&' . $this->args[$handle] : '?' . $this->args[$handle]; 41 45 42 46 if ( $this->do_concat ) { … … 101 105 } 102 106 103 $src = add_query_arg('ver', $ver, $src); 107 if ( !empty($ver) ) 108 $src = add_query_arg('ver', $ver, $src); 104 109 $src = apply_filters( 'style_loader_src', $src, $handle ); 105 110 return esc_url( $src ); -
trunk/wp-includes/functions.wp-scripts.php
r10572 r12558 39 39 * 40 40 * @since r16 41 * @see WP_Dependencies::add() For parameter information. 41 * @param string $handle Script name 42 * @param string $src Script url 43 * @param array $deps (optional) Array of script names on which this script depends 44 * @param string|bool $ver (optional) Script version (used for cache busting), set to NULL to disable 45 * @param bool (optional) Wether to enqueue the script before </head> or before </body> 46 * @return null 42 47 */ 43 48 function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) { … … 57 62 * 58 63 * @since r16 59 * @see WP_Script ::localize()64 * @see WP_Scripts::localize() 60 65 */ 61 66 function wp_localize_script( $handle, $object_name, $l10n ) { … … 87 92 * 88 93 * @since r16 89 * @see WP_Script::add(), WP_Script::enqueue()90 */94 * @see wp_register_script() For parameter information. 95 */ 91 96 function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) { 92 97 global $wp_scripts; -
trunk/wp-includes/functions.wp-styles.php
r12531 r12558 46 46 * @param array $deps Array of handles of any stylesheet that this stylesheet depends on. 47 47 * (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies. 48 * @param string|bool $ver String specifying the stylesheet version number, if it has one. This parameter 49 * is used to ensure that the correct version is sent to the client regardless of caching, and so should be included 50 * if a version number is available and makes sense for the stylesheet. 48 * @param string|bool $ver String specifying the stylesheet version number. Set to NULL to disable. 49 * Used to ensure that the correct version is sent to the client regardless of caching. 51 50 * @param string $media The media for which this stylesheet has been defined. 52 51 */ … … 78 77 /** 79 78 * Enqueue a CSS style file. 79 * 80 * Registers the style if src provided (does NOT overwrite) and enqueues. 80 81 * 81 82 * @since r79
Note: See TracChangeset
for help on using the changeset viewer.