WordPress.org

Make WordPress Core

Changeset 10978


Ignore:
Timestamp:
04/17/2009 05:30:09 AM (9 years ago)
Author:
ryan
Message:

Use comments_open() and pings_open() in packaged themes. Props coffee2code. fixes #9556

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r10867 r10978  
    250250    <thead>
    251251    <tr>
    252         <th scope="col" class="check-column"><input type="checkbox" /></th>
    253         <th scope="col"><?php _e('Plugin'); ?></th>
    254         <th scope="col" class="num"><?php _e('Version'); ?></th>
    255         <th scope="col"><?php _e('Description'); ?></th>
    256         <th scope="col" class="action-links"><?php _e('Action'); ?></th>
     252        <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
     253        <th scope="col" class="manage-column"><?php _e('Plugin'); ?></th>
     254        <th scope="col" class="manage-column num"><?php _e('Version'); ?></th>
     255        <th scope="col" class="manage-column"><?php _e('Description'); ?></th>
    257256    </tr>
    258257    </thead>
     
    260259    <tfoot>
    261260    <tr>
    262         <th scope="col" class="check-column"><input type="checkbox" /></th>
    263         <th scope="col"><?php _e('Plugin'); ?></th>
    264         <th scope="col" class="num"><?php _e('Version'); ?></th>
    265         <th scope="col"><?php _e('Description'); ?></th>
    266         <th scope="col" class="action-links"><?php _e('Action'); ?></th>
     261        <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
     262        <th scope="col" class="manage-column"><?php _e('Plugin'); ?></th>
     263        <th scope="col" class="manage-column num"><?php _e('Version'); ?></th>
     264        <th scope="col" class="manage-column"><?php _e('Description'); ?></th>
    267265    </tr>
    268266    </tfoot>
     
    277275    }
    278276    foreach ( (array)$plugins as $plugin_file => $plugin_data) {
    279         $action_links = array();
     277        $actions = array();
    280278
    281279        if ( 'active' == $context )
    282             $action_links[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
     280            $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
    283281        else //Inactive or Recently deactivated
    284             $action_links[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
     282            $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
    285283
    286284        if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
    287             $action_links[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
    288 
    289         $action_links = apply_filters( 'plugin_action_links', $action_links, $plugin_file, $plugin_data, $context );
    290         $action_links = apply_filters( "plugin_action_links_$plugin_file", $action_links, $plugin_file, $plugin_data, $context );
     285            $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
     286
     287        $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
     288        $actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
     289        $action_count = count($actions);
    291290
    292291        echo "
    293292    <tr class='$context'>
    294293        <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . attribute_escape($plugin_file) . "' /></th>
    295         <td class='name'>{$plugin_data['Title']}</td>
     294        <td class='plugin-title'><strong>{$plugin_data['Title']}</strong>";
     295        $i = 0;
     296        echo '<div class="row-actions">';
     297        foreach ( $actions as $action => $link ) {
     298            ++$i;
     299            ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
     300            echo "<span class='$action'>$link$sep</span>";
     301        }
     302        echo '</div>';
     303        echo "</td>
    296304        <td class='vers'>{$plugin_data['Version']}</td>
    297         <td class='desc'><p>{$plugin_data['Description']}</p></td>
    298         <td class='togl action-links'>";
    299         if ( !empty($action_links) )
    300             echo implode(' | ', $action_links);
     305        <td class='desc'><p>{$plugin_data['Description']}</p>";
    301306        echo '</td>
    302307    </tr>';
  • trunk/wp-admin/wp-admin.css

    r10943 r10978  
    19821982/* Edit posts */
    19831983
    1984 td.post-title strong {
     1984td.post-title strong, td.plugin-title strong {
    19851985    display: block;
    19861986    margin-bottom: .2em;
    19871987}
    19881988
    1989 td.post-title p {
     1989td.post-title p, td.plugin-title p {
    19901990    margin: 6px 0;
     1991}
     1992
     1993td.plugin-title {
     1994    white-space: nowrap;
    19911995}
    19921996
  • trunk/wp-content/themes/classic/comments-popup.php

    r10767 r10978  
    3131<p><a href="<?php echo get_post_comments_feed_link($post->ID); ?>"><?php _e("<abbr title=\"Really Simple Syndication\">RSS</abbr> feed for comments on this post."); ?></a></p>
    3232
    33 <?php if ('open' == $post->ping_status) { ?>
     33<?php if ( pings_open() ) { ?>
    3434<p><?php _e("The <abbr title=\"Universal Resource Locator\">URL</abbr> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p>
    3535<?php } ?>
     
    5959<?php } ?>
    6060
    61 <?php if ('open' == $commentstatus->comment_status) { ?>
     61<?php if ( comments_open($commentstatus) ) { ?>
    6262<h2><?php _e("Leave a comment"); ?></h2>
    6363<p><?php _e("Line and paragraph breaks automatic, e-mail address never displayed, <acronym title=\"Hypertext Markup Language\">HTML</acronym> allowed:"); ?> <code><?php echo allowed_tags(); ?></code></p>
  • trunk/wp-content/themes/default/comments-popup.php

    r9336 r10978  
    3030<p><a href="<?php echo get_post_comments_feed_link($post->ID); ?>"><abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.</a></p>
    3131
    32 <?php if ('open' == $post->ping_status) { ?>
     32<?php if ( pings_open() ) { ?>
    3333<p>The <abbr title="Universal Resource Locator">URL</abbr> to TrackBack this entry is: <em><?php trackback_url() ?></em></p>
    3434<?php } ?>
     
    5858<?php } ?>
    5959
    60 <?php if ('open' == $post->comment_status) { ?>
     60<?php if ( comments_open() ) { ?>
    6161<h2>Leave a comment</h2>
    6262<p>Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>
  • trunk/wp-content/themes/default/comments.php

    r10931 r10978  
    3636 <?php else : // this is displayed if there are no comments so far ?>
    3737
    38     <?php if ('open' == $post->comment_status) : ?>
     38    <?php if ( comments_open() ) : ?>
    3939        <!-- If comments are open, but there are no comments. -->
    4040
     
    4747
    4848
    49 <?php if ('open' == $post->comment_status) : ?>
     49<?php if ( comments_open() ) : ?>
    5050
    5151<div id="respond">
  • trunk/wp-content/themes/default/image.php

    r8999 r10978  
    3333                        You can follow any responses to this entry through the <?php post_comments_feed_link('RSS 2.0'); ?> feed.
    3434
    35                         <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
     35                        <?php if ( comments_open() && pings_open() ) {
    3636                            // Both Comments and Pings are open ?>
    3737                            You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
    3838
    39                         <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
     39                        <?php } elseif ( !comments_open() && pings_open() ) {
    4040                            // Only Pings are Open ?>
    4141                            Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
    4242
    43                         <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
     43                        <?php } elseif ( comments_open() && !pings_open() ) {
    4444                            // Comments are open, Pings are not ?>
    4545                            You can skip to the end and leave a response. Pinging is currently not allowed.
    4646
    47                         <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
     47                        <?php } elseif ( !comments_open() && !pings_open() ) {
    4848                            // Neither Comments, nor Pings are open ?>
    4949                            Both comments and pings are currently closed.
  • trunk/wp-content/themes/default/single.php

    r10945 r10978  
    3737                        You can follow any responses to this entry through the <?php post_comments_feed_link('RSS 2.0'); ?> feed.
    3838
    39                         <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
     39                        <?php if ( comments_open() && pings_open() ) {
    4040                            // Both Comments and Pings are open ?>
    4141                            You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
    4242
    43                         <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
     43                        <?php } elseif ( !comments_open() && pings_open() ) {
    4444                            // Only Pings are Open ?>
    4545                            Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
    4646
    47                         <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
     47                        <?php } elseif ( comments_open() && !pings_open() ) {
    4848                            // Comments are open, Pings are not ?>
    4949                            You can skip to the end and leave a response. Pinging is currently not allowed.
    5050
    51                         <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
     51                        <?php } elseif ( !comments_open() && !pings_open() ) {
    5252                            // Neither Comments, nor Pings are open ?>
    5353                            Both comments and pings are currently closed.
Note: See TracChangeset for help on using the changeset viewer.