Changeset 36744
- Timestamp:
- 02/27/2016 08:33:57 PM (9 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-dependencies.php
r36732 r36744 1 1 <?php 2 2 /** 3 * BackPress Scripts enqueue3 * Dependencies API: WP_Dependencies base class 4 4 * 5 * Classes were refactored from the WP_Scripts and WordPress script enqueue API.5 * @since 2.6.0 6 6 * 7 * @since BackPress r74 7 * @package WordPress 8 * @subpackage Dependencies 9 */ 10 11 /** 12 * Core base class extended to register items. 8 13 * 9 * @package BackPress 14 * @package WordPress 15 * @since 2.6.0 10 16 * @uses _WP_Dependency 11 * @since r7412 17 */ 13 18 class WP_Dependencies { … … 78 83 79 84 /** 80 * Process the items and dependencies.85 * Processes the items and dependencies. 81 86 * 82 87 * Processes the items passed to it or the queue, and their dependencies. … … 117 122 118 123 /** 119 * Process a dependency.124 * Processes a dependency. 120 125 * 121 126 * @access public … … 130 135 131 136 /** 132 * Determine dependencies.137 * Determines dependencies. 133 138 * 134 139 * Recursively builds an array of items to process taking … … 140 145 * @since 2.8.0 Added the `$group` parameter. 141 146 * 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.147 * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings). 148 * @param bool $recursion Internal flag that function is calling itself. 149 * @param int|false $group Group level: (int) level, (false) no groups. 145 150 * @return bool True on success, false on failure. 146 151 */ -
trunk/src/wp-includes/class.wp-scripts.php
r36730 r36744 1 1 <?php 2 2 /** 3 * BackPress Scripts enqueue.3 * Dependencies API: WP_Scripts class 4 4 * 5 * These classes were refactored from the WordPress WP_Scripts and WordPress 6 * script enqueue API. 5 * @since 2.6.0 7 6 * 8 * @package BackPress9 * @s ince r167 * @package WordPress 8 * @subpackage Dependencies 10 9 */ 11 10 12 11 /** 13 * BackPress Scripts enqueue class.12 * Core class used to register scripts. 14 13 * 15 * @package BackPress14 * @package WordPress 16 15 * @uses WP_Dependencies 17 * @since r1616 * @since 2.1.0 18 17 */ 19 18 class WP_Scripts extends WP_Dependencies { … … 30 29 31 30 /** 31 * URL of the content directory. 32 32 * 33 33 * @since 2.8.0 … … 38 38 39 39 /** 40 * Default version string for stylesheets. 40 41 * 41 42 * @since 2.6.0 … … 46 47 47 48 /** 49 * Holds handles of scripts which are enqueued in footer. 48 50 * 49 51 * @since 2.8.0 … … 54 56 55 57 /** 58 * Holds a list of script handles which will be concatenated. 56 59 * 57 60 * @since 2.8.0 … … 62 65 63 66 /** 64 * 65 * @since 2.8.0 67 * Holds a string which contains script handles and their version. 68 * 69 * @since 2.8.0 70 * @deprecated 3.4.0 66 71 * @access public 67 72 * @var string … … 70 75 71 76 /** 77 * Whether to perform concatenation. 72 78 * 73 79 * @since 2.8.0 … … 78 84 79 85 /** 86 * Holds HTML markup of scripts and additional data if concatenation 87 * is enabled. 80 88 * 81 89 * @since 2.8.0 … … 94 102 95 103 /** 104 * Holds inline code if concatenation is enabled. 96 105 * 97 106 * @since 2.8.0 … … 102 111 103 112 /** 113 * Holds a list of script handles which are not in the default directory 114 * if concatenation is enabled. 115 * 116 * Unused in core. 104 117 * 105 118 * @since 2.8.0 … … 110 123 111 124 /** 125 * Holds a string which contains handles and versions of scripts which 126 * are not in the default directory if concatenation is enabled. 127 * 128 * Unused in core. 112 129 * 113 130 * @since 2.8.0 … … 118 135 119 136 /** 137 * List of default directories. 120 138 * 121 139 * @since 2.8.0 … … 173 191 174 192 /** 193 * Prints extra scripts of a registered script. 175 194 * 176 195 * @since 2.1.0 … … 181 200 * @see print_extra_script() 182 201 * 183 * @param string $handle 184 * @param bool $echo 185 * @return bool|string|void 202 * @param string $handle The script's registered handle. 203 * @param bool $echo Optional. Whether to echo the extra script instead of just returning it. 204 * Default true. 205 * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise. 186 206 */ 187 207 public function print_scripts_l10n( $handle, $echo = true ) { … … 191 211 192 212 /** 213 * Prints extra scripts of a registered script. 193 214 * 194 215 * @since 3.3.0 195 216 * @access public 196 217 * 197 * @param string $handle 198 * @param bool $echo 199 * @return bool|string|void 218 * @param string $handle The script's registered handle. 219 * @param bool $echo Optional. Whether to echo the extra script instead of just returning it. 220 * Default true. 221 * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise. 200 222 */ 201 223 public function print_extra_script( $handle, $echo = true ) { … … 216 238 217 239 /** 240 * Processes a script dependency. 218 241 * 219 242 * @since 2.6.0 … … 221 244 * @access public 222 245 * 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. 246 * @see WP_Dependencies::do_item() 247 * 248 * @param string $handle The script's registered handle. 249 * @param int|false $group Optional. Group level: (int) level, (false) no groups. Default false. 250 * @return bool True on success, false on failure. 226 251 */ 227 252 public function do_item( $handle, $group = false ) { … … 407 432 408 433 /** 409 * Localizes a script, only if the script has already been added 434 * Localizes a script, only if the script has already been added. 410 435 * 411 436 * @since 2.1.0 … … 447 472 448 473 /** 449 * 450 * @since 2.8.0 451 * @access public 452 * 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. 474 * Sets handle group. 475 * 476 * @since 2.8.0 477 * @access public 478 * 479 * @see WP_Dependencies::set_group() 480 * 481 * @param string $handle Name of the item. Should be unique. 482 * @param bool $recursion Internal flag that calling function was called recursively. 483 * @param int|false $group Optional. Group level: (int) level, (false) no groups. Default false. 456 484 * @return bool Not already in the group or a lower group 457 485 */ … … 469 497 470 498 /** 471 * 499 * Determines script dependencies. 500 * 472 501 * @since 2.1.0 473 502 * @access public 474 503 * 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. 504 * @see WP_Dependencies::all_deps() 505 * 506 * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings). 507 * @param bool $recursion Internal flag that function is calling itself. 508 * @param int|false $group Optional. Group level: (int) level, (false) no groups. Default false. 478 509 * @return bool True on success, false on failure. 479 510 */ … … 494 525 495 526 /** 496 * 497 * @since 2.8.0 498 * @access public 499 * 500 * @return array 527 * Processes items and dependencies for the head group. 528 * 529 * @since 2.8.0 530 * @access public 531 * 532 * @see WP_Dependencies::do_items() 533 * 534 * @return array Handles of items that have been processed. 501 535 */ 502 536 public function do_head_items() { … … 506 540 507 541 /** 508 * 509 * @since 2.8.0 510 * @access public 511 * 512 * @return array 542 * Processes items and dependencies for the footer group. 543 * 544 * @since 2.8.0 545 * @access public 546 * 547 * @see WP_Dependencies::do_items() 548 * 549 * @return array Handles of items that have been processed. 513 550 */ 514 551 public function do_footer_items() { … … 518 555 519 556 /** 520 * 521 * @since 2.8.0 522 * @access public 523 * 524 * @param string $src 525 * @return bool 557 * Whether a handle's source is in a default directory. 558 * 559 * @since 2.8.0 560 * @access public 561 * 562 * @param string $src The source of the enqueued script. 563 * @return bool True if found, false if not. 526 564 */ 527 565 public function in_default_dir( $src ) { … … 543 581 544 582 /** 583 * Resets class properties. 545 584 * 546 585 * @since 2.8.0 -
trunk/src/wp-includes/class.wp-styles.php
r36733 r36744 1 1 <?php 2 2 /** 3 * BackPress Styles enqueue.3 * Dependencies API: WP_Styles class 4 4 * 5 * These classes were refactored from the WordPress WP_Scripts and WordPress 6 * script enqueue API. 5 * @since 2.6.0 7 6 * 8 * @package BackPress9 * @s ince r747 * @package WordPress 8 * @subpackage Dependencies 10 9 */ 11 10 12 11 /** 13 * BackPress Styles enqueue class.12 * Core class used to register styles. 14 13 * 15 * @package BackPress14 * @package WordPress 16 15 * @uses WP_Dependencies 17 * @since r7416 * @since 2.6.0 18 17 */ 19 18 class WP_Styles extends WP_Dependencies { … … 30 29 31 30 /** 31 * URL of the content directory. 32 32 * 33 33 * @since 2.8.0 … … 38 38 39 39 /** 40 * Default version string for stylesheets. 40 41 * 41 42 * @since 2.6.0 … … 46 47 47 48 /** 49 * The current text direction. 48 50 * 49 51 * @since 2.6.0 … … 54 56 55 57 /** 58 * Holds a list of style handles which will be concatenated. 56 59 * 57 60 * @since 2.8.0 … … 62 65 63 66 /** 64 * 65 * @since 2.8.0 67 * Holds a string which contains style handles and their version. 68 * 69 * @since 2.8.0 70 * @deprecated 3.4.0 66 71 * @access public 67 72 * @var string … … 70 75 71 76 /** 77 * Whether to perform concatenation. 72 78 * 73 79 * @since 2.8.0 … … 78 84 79 85 /** 86 * Holds HTML markup of styles and additional data if concatenation 87 * is enabled. 80 88 * 81 89 * @since 2.8.0 … … 86 94 87 95 /** 96 * Holds inline styles if concatenation is enabled. 88 97 * 89 98 * @since 3.3.0 … … 94 103 95 104 /** 105 * List of default directories. 96 106 * 97 107 * @since 2.8.0 … … 119 129 120 130 /** 121 * 122 * @since 2.6.0 123 * @access public 124 * 125 * @param string $handle 126 * @return bool 131 * Processes a style dependency. 132 * 133 * @since 2.6.0 134 * @access public 135 * 136 * @see WP_Dependencies::do_item() 137 * 138 * @param string $handle The style's registered handle. 139 * @return bool True on success, false on failure. 127 140 */ 128 141 public function do_item( $handle ) { … … 231 244 232 245 /** 246 * Adds extra CSS styles to a registered stylesheet. 233 247 * 234 248 * @since 3.3.0 235 249 * @access public 236 250 * 237 * @param string $handle 238 * @param string $code 251 * @param string $handle The style's registered handle. 252 * @param string $code String containing the CSS styles to be added. 253 * @return bool True on success, false on failure. 239 254 */ 240 255 public function add_inline_style( $handle, $code ) { … … 254 269 255 270 /** 271 * Prints extra CSS styles of a registered stylesheet. 256 272 * 257 273 * @since 3.3.0 258 274 * @access public 259 275 * 260 * @param string $handle 261 * @param bool $echo 262 * @return bool 276 * @param string $handle The style's registered handle. 277 * @param bool $echo Optional. Whether to echo the inline style instead of just returning it. 278 * Default true. 279 * @return string|bool False if no data exists, inline styles if `$echo` is true, true otherwise. 263 280 */ 264 281 public function print_inline_style( $handle, $echo = true ) { … … 281 298 282 299 /** 283 * 284 * @since 2.6.0 285 * @access public 286 * 287 * @param mixed $handles 288 * @param bool $recursion 289 * @param mixed $group 290 * @return bool 300 * Determines style dependencies. 301 * 302 * @since 2.6.0 303 * @access public 304 * 305 * @see WP_Dependencies::all_deps() 306 * 307 * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings). 308 * @param bool $recursion Internal flag that function is calling itself. 309 * @param int|false $group Group level: (int) level, (false) no groups. 310 * @return bool True on success, false on failure. 291 311 */ 292 312 public function all_deps( $handles, $recursion = false, $group = false ) { 293 313 $r = parent::all_deps( $handles, $recursion ); 294 if ( ! $recursion ) {314 if ( ! $recursion ) { 295 315 /** 296 316 * Filter the array of enqueued styles before processing for output. … … 306 326 307 327 /** 308 * 309 * @since 2.6.0 310 * @access public 311 * 312 * @param string $src 313 * @param string $ver 314 * @param string $handle 315 * @return string 328 * Generates an enqueued style's fully-qualified URL. 329 * 330 * @since 2.6.0 331 * @access public 332 * 333 * @param string $src The source of the enqueued style. 334 * @param string $ver The version of the enqueued style. 335 * @param string $handle The style's registered handle. 336 * @return string Style's fully-qualified URL. 316 337 */ 317 338 public function _css_href( $src, $ver, $handle ) { … … 336 357 337 358 /** 338 * 339 * @since 2.8.0 340 * @access public 341 * 342 * @param string $src 343 * @return bool 359 * Whether a handle's source is in a default directory. 360 * 361 * @since 2.8.0 362 * @access public 363 * 364 * @param string $src The source of the enqueued style. 365 * @return bool True if found, false if not. 344 366 */ 345 367 public function in_default_dir( $src ) { … … 355 377 356 378 /** 379 * Processes items and dependencies for the footer group. 357 380 * 358 381 * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer. … … 361 384 * @access public 362 385 * 363 * @return array 386 * @see WP_Dependencies::do_items() 387 * 388 * @return array Handles of items that have been processed. 364 389 */ 365 390 public function do_footer_items() { … … 369 394 370 395 /** 396 * Resets class properties. 371 397 * 372 398 * @since 3.3.0 -
trunk/src/wp-includes/functions.wp-scripts.php
r36729 r36744 1 1 <?php 2 2 /** 3 * BackPress Scripts Procedural API3 * Dependencies API: Scripts functions 4 4 * 5 5 * @since 2.6.0 6 6 * 7 7 * @package WordPress 8 * @subpackage BackPress8 * @subpackage Dependencies 9 9 */ 10 10 -
trunk/src/wp-includes/functions.wp-styles.php
r36649 r36744 1 1 <?php 2 2 /** 3 * BackPress Styles Procedural API3 * Dependencies API: Styles functions 4 4 * 5 5 * @since 2.6.0 6 6 * 7 7 * @package WordPress 8 * @subpackage BackPress8 * @subpackage Dependencies 9 9 */ 10 10 -
trunk/src/wp-includes/script-loader.php
r36733 r36744 2 2 /** 3 3 * WordPress scripts and styles default loader. 4 *5 * Most of the functionality that existed here was moved to6 * {@link http://backpress.automattic.com/ BackPress}. WordPress themes and7 * plugins will only be concerned about the filters and actions set in this8 * file.9 4 * 10 5 * Several constants are used to manage the loading, concatenating and compression of scripts and CSS: … … 22 17 */ 23 18 24 /** BackPress:WordPress Dependencies Class */19 /** WordPress Dependencies Class */ 25 20 require( ABSPATH . WPINC . '/class.wp-dependencies.php' ); 26 21 27 /** BackPress:WordPress Scripts Class */22 /** WordPress Scripts Class */ 28 23 require( ABSPATH . WPINC . '/class.wp-scripts.php' ); 29 24 30 /** BackPress:WordPress Scripts Functions */25 /** WordPress Scripts Functions */ 31 26 require( ABSPATH . WPINC . '/functions.wp-scripts.php' ); 32 27 33 /** BackPress:WordPress Styles Class */28 /** WordPress Styles Class */ 34 29 require( ABSPATH . WPINC . '/class.wp-styles.php' ); 35 30 36 /** BackPress:WordPress Styles Functions */31 /** WordPress Styles Functions */ 37 32 require( ABSPATH . WPINC . '/functions.wp-styles.php' ); 38 33
Note: See TracChangeset
for help on using the changeset viewer.