Changeset 47219 for trunk/src/wp-includes/class-wp-admin-bar.php
- Timestamp:
- 02/09/2020 04:52:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-admin-bar.php
r47122 r47219 319 319 320 320 foreach ( $this->_get_nodes() as $node ) { 321 if ( 'root' == $node->id ) {321 if ( 'root' === $node->id ) { 322 322 continue; 323 323 } … … 330 330 331 331 // Generate the group class (we distinguish between top level and other level groups). 332 $group_class = ( $node->parent == 'root') ? 'ab-top-menu' : 'ab-submenu';333 334 if ( $node->type == 'group') {332 $group_class = ( 'root' === $node->parent ) ? 'ab-top-menu' : 'ab-submenu'; 333 334 if ( 'group' === $node->type ) { 335 335 if ( empty( $node->meta['class'] ) ) { 336 336 $node->meta['class'] = $group_class; … … 341 341 342 342 // Items in items aren't allowed. Wrap nested items in 'default' groups. 343 if ( $parent->type == 'item' && $node->type == 'item') {343 if ( 'item' === $parent->type && 'item' === $node->type ) { 344 344 $default_id = $parent->id . '-default'; 345 345 $default = $this->_get_node( $default_id ); … … 370 370 // Groups in groups aren't allowed. Add a special 'container' node. 371 371 // The container will invisibly wrap both groups. 372 } elseif ( $parent->type == 'group' && $node->type == 'group') {372 } elseif ( 'group' === $parent->type && 'group' === $node->type ) { 373 373 $container_id = $parent->id . '-container'; 374 374 $container = $this->_get_node( $container_id ); … … 399 399 400 400 $index = array_search( $parent, $grandparent->children, true ); 401 if ( $index === false) {401 if ( false === $index ) { 402 402 $grandparent->children[] = $container; 403 403 } else { … … 470 470 */ 471 471 final protected function _render_container( $node ) { 472 if ( $node->type != 'container'|| empty( $node->children ) ) {472 if ( 'container' !== $node->type || empty( $node->children ) ) { 473 473 return; 474 474 } … … 485 485 */ 486 486 final protected function _render_group( $node ) { 487 if ( $node->type == 'container') {487 if ( 'container' === $node->type ) { 488 488 $this->_render_container( $node ); 489 489 return; 490 490 } 491 if ( $node->type != 'group'|| empty( $node->children ) ) {491 if ( 'group' !== $node->type || empty( $node->children ) ) { 492 492 return; 493 493 } … … 510 510 */ 511 511 final protected function _render_item( $node ) { 512 if ( $node->type != 'item') {512 if ( 'item' !== $node->type ) { 513 513 return; 514 514 }
Note: See TracChangeset
for help on using the changeset viewer.