Changeset 34370
- Timestamp:
- 09/22/2015 03:36:27 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-screen.php
r34169 r34370 513 513 public function get_help_tabs() { 514 514 $help_tabs = $this->_help_tabs; 515 uasort( $help_tabs, array( $this, '_sort_help_tabs' ) ); 516 return $help_tabs; 517 } 518 519 /** 520 * Compares the difference between the help tabs priorities. 521 * 522 * Used for help tabs sorting. 523 * 524 * @since 4.4.0 525 * 526 * @param int $tab_a The priority argument for the first tab. 527 * @param int $tab_b The priority argument for the second tab. 528 * @return int The difference between the priority arguments. 529 */ 530 protected function _sort_help_tabs( $tab_a, $tab_b ) { 531 return $tab_a['priority'] - $tab_b['priority']; 515 516 $priorities = array(); 517 foreach ( $help_tabs as $help_tab ) { 518 if ( isset( $priorities[ $help_tab['priority'] ] ) ) { 519 $priorities[ $help_tab['priority'] ][] = $help_tab; 520 } else { 521 $priorities[ $help_tab['priority'] ] = array( $help_tab ); 522 } 523 } 524 525 sort( $priorities ); 526 527 $sorted = array(); 528 foreach ( $priorities as $list ) { 529 foreach ( $list as $tab ) { 530 $sorted[ $tab['id'] ] = $tab; 531 } 532 } 533 534 return $sorted; 532 535 } 533 536 -
trunk/tests/phpunit/tests/admin/includesScreen.php
r33985 r34370 39 39 function tearDown() { 40 40 unset( $GLOBALS['wp_taxonomies']['old-or-new'] ); 41 set_current_screen( 'front');41 unset( $GLOBALS['screen'] ); 42 42 parent::tearDown(); 43 43 }
Note: See TracChangeset
for help on using the changeset viewer.