WordPress.org

Make WordPress Core

Ticket #8444: 8444.discover-level.diff

File 8444.discover-level.diff, 686 bytes (added by jbsil, 5 years ago)

fixed typo

  • template.php

     
    15641564        $post = $page; 
    15651565        setup_postdata($page); 
    15661566 
     1567        if ( 0 == $level && (int)$page->post_parent > 0) { 
     1568                //sent level 0 by accident, by default, or because we don't know the actual level 
     1569                $find_main_page = (int)$page->post_parent; 
     1570                while ($find_main_page > 0) { 
     1571                        $level++; 
     1572                        $parent = get_page($find_main_page); 
     1573                        $find_main_page = (int)$parent->post_parent; 
     1574                } 
     1575        } 
     1576 
    15671577        $page->post_title = wp_specialchars( $page->post_title ); 
    15681578        $pad = str_repeat( '— ', $level ); 
    15691579        $id = (int) $page->ID;