Changeset 29252
- Timestamp:
- 07/20/2014 12:28:57 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-dependencies.php
r28517 r29252 326 326 327 327 /** 328 * Recursively search the passed dependency tree for $handle 329 * 330 * @since 4.0.0 331 * 332 * @param array $queue An array of queued _WP_Dependency handle objects. 333 * @param string $handle Name of the item. Should be unique. 334 * @return boolean Whether the handle is found after recursively searching the dependency tree. 335 */ 336 protected function recurse_deps( $queue, $handle ) { 337 foreach ( $queue as $queued ) { 338 if ( ! isset( $this->registered[ $queued ] ) ) { 339 continue; 340 } 341 342 if ( in_array( $handle, $this->registered[ $queued ]->deps ) ) { 343 return true; 344 } else { 345 return $this->recurse_deps( $this->registered[ $queued ]->deps, $handle ); 346 } 347 } 348 349 return false; 350 } 351 352 /** 328 353 * Query list for an item. 329 354 * … … 345 370 case 'enqueued' : 346 371 case 'queue' : 347 return in_array( $handle, $this->queue ); 372 if ( in_array( $handle, $this->queue ) ) { 373 return true; 374 } 375 return $this->recurse_deps( $this->queue, $handle ); 348 376 349 377 case 'to_do' : -
trunk/tests/phpunit/tests/dependencies/jquery.php
r25785 r29252 70 70 $this->assertFalse( strpos( $contents, 'sourceMappingURL' ), 'Presence of sourceMappingURL' ); 71 71 } 72 73 /** 74 * @ticket 28404 75 */ 76 function test_wp_script_is_dep_enqueued() { 77 wp_enqueue_script( 'jquery-ui-accordion' ); 78 79 $this->assertTrue( wp_script_is( 'jquery', 'enqueued' ) ); 80 $this->assertFalse( wp_script_is( 'underscore', 'enqueued' ) ); 81 82 unset( $GLOBALS['wp_scripts'] ); 83 } 72 84 }
Note: See TracChangeset
for help on using the changeset viewer.