WordPress.org

Make WordPress Core

Changeset 8692


Ignore:
Timestamp:
08/20/2008 09:52:47 PM (10 years ago)
Author:
ryan
Message:

New row style for Content->Pages. see #7552

File:
1 edited

Legend:

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

    r8682 r8692  
    383383    $posts_columns['cb'] = '<input type="checkbox" />';
    384384
     385    $posts_columns['title'] = __('Title');
     386
    385387    $post_status = isset( $_GET['post_status'] ) ? $_GET['post_status'] : '';
    386388
     
    396398    }
    397399
    398     $posts_columns['title'] = __('Title');
    399400    $posts_columns['author'] = __('Author');
    400401    if ( !in_array($post_status, array('pending', 'draft', 'future')) )
     
    469470    case 'title':
    470471        ?>
    471         <td><strong><a class="row-title" href="<?php echo get_edit_post_link( $page->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a></strong>
    472         <?php if ('private' == $page->post_status) _e(' &#8212; <strong>Private</strong>'); ?></td>
     472        <td class="post-title"><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 $title ?></a><?php } else { echo $title; } ?></strong>
     473        <?php
     474        if ( !empty($post->post_password) ) { _e(' &#8212; <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' &#8212; <strong>Private</strong>'); }
     475
     476        if ( 'excerpt' == $mode )
     477            the_excerpt();
     478
     479        $actions = array();
     480        $actions['edit'] = '<a href="' . get_edit_post_link( $page->ID ) . '">' . __('Edit') . '</a>';
     481        $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-post_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n  'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     482        $action_count = count($actions);
     483        $i = 0;
     484        foreach ( $actions as $action => $link ) {
     485            ++$i;
     486            ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
     487            echo "<span class='$action'>$link$sep</span>";
     488        }
     489        ?>
     490        </td>
    473491        <?php
    474492        break;
Note: See TracChangeset for help on using the changeset viewer.