Make WordPress Core

Changeset 10968


Ignore:
Timestamp:
04/17/2009 12:07:22 AM (15 years ago)
Author:
azaozz
Message:

Fix listing of child pages after editing with Quick Edit, props jbsil, fixes #8444

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r10943 r10968  
    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            $parent = get_page($find_main_page);
     1572           
     1573            if ( is_null($parent) )
     1574                break;
     1575           
     1576            $level++;
     1577            $find_main_page = (int)$parent->post_parent;
     1578           
     1579            if ( !isset($parent_name) )
     1580                $parent_name = $parent->post_title;
     1581        }
     1582    }
     1583
    15671584    $page->post_title = wp_specialchars( $page->post_title );
    15681585    $pad = str_repeat( '— ', $level );
     
    16271644        $edit_link = get_edit_post_link( $page->ID );
    16281645        ?>
    1629         <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); ?></strong>
     1646        <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . wp_specialchars($parent_name) : ''; ?></strong>
    16301647        <?php
    16311648        $actions = array();
Note: See TracChangeset for help on using the changeset viewer.