Ticket #35964: 35964.patch
File 35964.patch, 13.7 KB (added by , 9 years ago) |
---|
-
src/wp-includes/class.wp-dependencies.php
77 77 public $group = 0; 78 78 79 79 /** 80 * Process the items and dependencies.80 * Processes the items and dependencies. 81 81 * 82 82 * Processes the items passed to it or the queue, and their dependencies. 83 83 * … … 116 116 } 117 117 118 118 /** 119 * Process a dependency.119 * Processes a dependency. 120 120 * 121 121 * @access public 122 122 * @since 2.6.0 … … 129 129 } 130 130 131 131 /** 132 * Determine dependencies.132 * Determines dependencies. 133 133 * 134 134 * Recursively builds an array of items to process taking 135 135 * dependencies into account. Does NOT catch infinite loops. … … 139 139 * @since 2.6.0 Moved from `WP_Scripts`. 140 140 * @since 2.8.0 Added the `$group` parameter. 141 141 * 142 * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).143 * @param bool $recursion Internal flag that function is calling itself.144 * @param mixed$group Group level: (int) level, (false) no groups.142 * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings). 143 * @param bool $recursion Internal flag that function is calling itself. 144 * @param int|false $group Group level: (int) level, (false) no groups. 145 145 * @return bool True on success, false on failure. 146 146 */ 147 147 public function all_deps( $handles, $recursion = false, $group = false ) { -
src/wp-includes/class.wp-scripts.php
29 29 public $base_url; 30 30 31 31 /** 32 * URL of the content URL. 32 33 * 34 * Usually the value of `WP_CONTENT_URL`. 35 * 33 36 * @since 2.8.0 34 37 * @access public 35 38 * @var string … … 37 40 public $content_url; 38 41 39 42 /** 43 * Default version string for stylesheets. 40 44 * 45 * Usually the value of `get_bloginfo( 'version' )`. 46 * 41 47 * @since 2.6.0 42 48 * @access public 43 49 * @var string … … 45 51 public $default_version; 46 52 47 53 /** 54 * Holds handles of scripts which are enqueued in footer. 48 55 * 49 56 * @since 2.8.0 50 57 * @access public … … 53 60 public $in_footer = array(); 54 61 55 62 /** 63 * Holds list of script handles which will be concatenated. 56 64 * 57 65 * @since 2.8.0 58 66 * @access public … … 61 69 public $concat = ''; 62 70 63 71 /** 72 * Holds a string which contains script handles and their version. 64 73 * 65 74 * @since 2.8.0 75 * @deprecated 3.4.0 66 76 * @access public 67 77 * @var string 68 78 */ 69 79 public $concat_version = ''; 70 80 71 81 /** 82 * Whether to perform concatenation. 72 83 * 73 84 * @since 2.8.0 74 85 * @access public … … 77 88 public $do_concat = false; 78 89 79 90 /** 91 * Holds HTML markup of scripts and additional data if concatenation 92 * is enabled. 80 93 * 81 94 * @since 2.8.0 82 95 * @access public … … 93 106 public $print_html_before = ''; 94 107 95 108 /** 109 * Holds inline code if concatenation is enabled. 96 110 * 97 111 * @since 2.8.0 98 112 * @access public … … 101 115 public $print_code = ''; 102 116 103 117 /** 118 * Holds list of script handles which are not in the default directory 119 * if concatenation is enabled. 104 120 * 105 121 * @since 2.8.0 106 122 * @access public … … 109 125 public $ext_handles = ''; 110 126 111 127 /** 128 * Holds a string which contains handles and versions of scripts which 129 * are not in the default directory if concatenation is enabled. 112 130 * 113 131 * @since 2.8.0 114 132 * @access public … … 117 135 public $ext_version = ''; 118 136 119 137 /** 138 * List of default directories. 120 139 * 121 140 * @since 2.8.0 122 141 * @access public … … 172 191 } 173 192 174 193 /** 194 * Prints extra scripts of a registered script. 175 195 * 176 196 * @since 2.1.0 177 197 * @since 2.8.0 Added the `$echo` parameter. … … 180 200 * 181 201 * @see print_extra_script() 182 202 * 183 * @param string $handle 184 * @param bool $echo 185 * @return bool|string|void 203 * @param string $handle The script's registered handle. 204 * @param bool $echo Optional. Whether to echo the extra script instead of just returning it. 205 * Default true. 206 * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise. 186 207 */ 187 208 public function print_scripts_l10n( $handle, $echo = true ) { 188 209 _deprecated_function( __FUNCTION__, '3.3', 'print_extra_script()' ); … … 190 211 } 191 212 192 213 /** 214 * Prints extra scripts of a registered script. 193 215 * 194 216 * @since 3.3.0 195 217 * @access public 196 218 * 197 * @param string $handle 198 * @param bool $echo 199 * @return bool|string|void 219 * @param string $handle The script's registered handle. 220 * @param bool $echo Optional. Whether to echo the extra script instead of just returning it. 221 * Default true. 222 * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise. 200 223 */ 201 224 public function print_extra_script( $handle, $echo = true ) { 202 225 if ( !$output = $this->get_data( $handle, 'data' ) ) … … 215 238 } 216 239 217 240 /** 241 * Processes a script dependency. 218 242 * 219 243 * @since 2.6.0 220 244 * @since 2.8.0 Added the `$group` parameter. 221 245 * @access public 222 246 * 223 * @param string $handle Name of the item. Should be unique. 224 * @param int|bool $group 225 * @return bool True on success, false if not set. 247 * @see WP_Dependencies::do_item() 248 * 249 * @param string $handle The script's registered handle. 250 * @param int|false $group Optional. Group level: (int) level, (false) no groups. Default false. 251 * @return bool True on success, false on failure. 226 252 */ 227 253 public function do_item( $handle, $group = false ) { 228 254 if ( !parent::do_item($handle) ) … … 446 472 } 447 473 448 474 /** 475 * Sets handle group. 449 476 * 450 477 * @since 2.8.0 451 478 * @access public 452 479 * 453 * @param string $handle Name of the item. Should be unique. 454 * @param bool $recursion Internal flag that calling function was called recursively. 455 * @param mixed $group Group level. 480 * @see WP_Dependencies::set_group() 481 * 482 * @param string $handle Name of the item. Should be unique. 483 * @param bool $recursion Internal flag that calling function was called recursively. 484 * @param int|false $group Optional. Group level: (int) level, (false) no groups. Default false. 456 485 * @return bool Not already in the group or a lower group 457 486 */ 458 487 public function set_group( $handle, $recursion, $group = false ) { … … 468 497 } 469 498 470 499 /** 471 * 500 * Determines script dependencies. 501 * 472 502 * @since 2.1.0 473 503 * @access public 474 504 * 475 * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings). 476 * @param bool $recursion Internal flag that function is calling itself. 477 * @param mixed $group Group level: (int) level, (false) no groups. 505 * @see WP_Dependencies::all_deps() 506 * 507 * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings). 508 * @param bool $recursion Internal flag that function is calling itself. 509 * @param int|false $group Optional. Group level: (int) level, (false) no groups. Default false. 478 510 * @return bool True on success, false on failure. 479 511 */ 480 512 public function all_deps( $handles, $recursion = false, $group = false ) { … … 493 525 } 494 526 495 527 /** 528 * Processes items and dependencies for the head group. 496 529 * 497 530 * @since 2.8.0 498 531 * @access public 499 532 * 500 * @return array 533 * @see WP_Dependencies::do_items() 534 * 535 * @return array Handles of items that have been processed. 501 536 */ 502 537 public function do_head_items() { 503 538 $this->do_items(false, 0); … … 505 540 } 506 541 507 542 /** 543 * Processes items and dependencies for the footer group. 508 544 * 509 545 * @since 2.8.0 510 546 * @access public 511 547 * 512 * @return array 548 * @see WP_Dependencies::do_items() 549 * 550 * @return array Handles of items that have been processed. 513 551 */ 514 552 public function do_footer_items() { 515 553 $this->do_items(false, 1); … … 517 555 } 518 556 519 557 /** 558 * Whether a handle's source is in a default directory. 520 559 * 521 560 * @since 2.8.0 522 561 * @access public 523 562 * 524 * @param string $src 525 * @return bool 563 * @param string $src The source of the enqueued script. 564 * @return bool True if found, false if not. 526 565 */ 527 566 public function in_default_dir( $src ) { 528 567 if ( ! $this->default_dirs ) { … … 542 581 } 543 582 544 583 /** 584 * Resets class properties. 545 585 * 546 586 * @since 2.8.0 547 587 * @access public -
src/wp-includes/class.wp-styles.php
29 29 public $base_url; 30 30 31 31 /** 32 * URL of the content URL. 32 33 * 34 * Usually the value of `WP_CONTENT_URL`. 35 * 33 36 * @since 2.8.0 34 37 * @access public 35 38 * @var string … … 37 40 public $content_url; 38 41 39 42 /** 43 * Default version string for stylesheets. 40 44 * 45 * Usually the value of `get_bloginfo( 'version' )`. 46 * 41 47 * @since 2.6.0 42 48 * @access public 43 49 * @var string … … 45 51 public $default_version; 46 52 47 53 /** 54 * The current text direction. 48 55 * 49 56 * @since 2.6.0 50 57 * @access public … … 53 60 public $text_direction = 'ltr'; 54 61 55 62 /** 63 * Holds list of style handles which will be concatenated. 56 64 * 57 65 * @since 2.8.0 58 66 * @access public … … 61 69 public $concat = ''; 62 70 63 71 /** 72 * Holds a string which contains style handles and their version. 64 73 * 65 74 * @since 2.8.0 75 * @deprecated 3.4.0 66 76 * @access public 67 77 * @var string 68 78 */ 69 79 public $concat_version = ''; 70 80 71 81 /** 82 * Whether to perform concatenation. 72 83 * 73 84 * @since 2.8.0 74 85 * @access public … … 77 88 public $do_concat = false; 78 89 79 90 /** 91 * Holds HTML markup of scripts and additional data if concatenation 92 * is enabled. 80 93 * 81 94 * @since 2.8.0 82 95 * @access public … … 85 98 public $print_html = ''; 86 99 87 100 /** 101 * Holds inline styles if concatenation is enabled. 88 102 * 89 103 * @since 3.3.0 90 104 * @access public … … 93 107 public $print_code = ''; 94 108 95 109 /** 110 * List of default directories. 96 111 * 97 112 * @since 2.8.0 98 113 * @access public … … 118 133 } 119 134 120 135 /** 136 * Processes a style dependency. 121 137 * 122 138 * @since 2.6.0 123 139 * @access public 124 140 * 125 * @param string $handle 126 * @return bool 141 * @see WP_Dependencies::do_item() 142 * 143 * @param string $handle The style's registered handle. 144 * @return bool True on success, false on failure. 127 145 */ 128 146 public function do_item( $handle ) { 129 147 if ( !parent::do_item($handle) ) … … 230 248 } 231 249 232 250 /** 251 * Add extra CSS styles to a registered stylesheet. 233 252 * 234 253 * @since 3.3.0 235 254 * @access public 236 255 * 237 * @param string $handle 238 * @param string $code 256 * @param string $handle The style's registered handle. 257 * @param string $code String containing the CSS styles to be added. 258 * @return bool True on success, false on failure. 239 259 */ 240 260 public function add_inline_style( $handle, $code ) { 241 261 if ( ! $code ) { … … 253 273 } 254 274 255 275 /** 276 * Prints extra CSS styles of a registered stylesheet. 256 277 * 257 278 * @since 3.3.0 258 279 * @access public 259 280 * 260 * @param string $handle 261 * @param bool $echo 262 * @return bool 281 * @param string $handle The style's registered handle. 282 * @param bool $echo Optional. Whether to echo the inline style instead of just returning it. 283 * Default true. 284 * @return string|bool False if no data exists, inline styles if `$echo` is true, true otherwise. 263 285 */ 264 286 public function print_inline_style( $handle, $echo = true ) { 265 287 $output = $this->get_data( $handle, 'after' ); … … 280 302 } 281 303 282 304 /** 305 * Determines style dependencies. 283 306 * 284 307 * @since 2.6.0 285 308 * @access public 286 309 * 287 * @param mixed $handles 288 * @param bool $recursion 289 * @param mixed $group 290 * @return bool 310 * @see WP_Dependencies::all_deps() 311 * 312 * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings). 313 * @param bool $recursion Internal flag that function is calling itself. 314 * @param int|false $group Group level: (int) level, (false) no groups. 315 * @return bool True on success, false on failure. 291 316 */ 292 317 public function all_deps( $handles, $recursion = false, $group = false ) { 293 318 $r = parent::all_deps( $handles, $recursion ); 294 if ( ! $recursion ) {319 if ( ! $recursion ) { 295 320 /** 296 321 * Filter the array of enqueued styles before processing for output. 297 322 * … … 305 330 } 306 331 307 332 /** 333 * Generates an enqueued style's fully-qualified URL. 308 334 * 309 335 * @since 2.6.0 310 336 * @access public 311 337 * 312 * @param string $src 313 * @param string $ver 314 * @param string $handle 338 * @param string $src The source of the enqueued style. 339 * @param string $ver The version of the enqueued style. 340 * @param string $handle The style's registered handle. 315 341 * @return string 316 342 */ 317 343 public function _css_href( $src, $ver, $handle ) { … … 335 361 } 336 362 337 363 /** 364 * Whether a handle's source is in a default directory. 338 365 * 339 366 * @since 2.8.0 340 367 * @access public 341 368 * 342 * @param string $src 343 * @return bool 369 * @param string $src The source of the enqueued style. 370 * @return bool True if found, false if not. 344 371 */ 345 372 public function in_default_dir( $src ) { 346 373 if ( ! $this->default_dirs ) … … 354 381 } 355 382 356 383 /** 384 * Processes items and dependencies for the footer group. 357 385 * 358 386 * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer. 359 387 * 360 388 * @since 3.3.0 361 389 * @access public 362 390 * 363 * @return array 391 * @see WP_Dependencies::do_items() 392 * 393 * @return array Handles of items that have been processed. 364 394 */ 365 395 public function do_footer_items() { 366 396 $this->do_items(false, 1); … … 368 398 } 369 399 370 400 /** 401 * Resets class properties. 371 402 * 372 403 * @since 3.3.0 373 404 * @access public