Make WordPress Core


Ignore:
Timestamp:
08/18/2010 04:30:27 PM (16 years ago)
Author:
scribu
Message:

introduce WP_List_Table::comments_bubble(); revert to edit-comments.php?p=123. See #14579

File:
1 edited

Legend:

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

    r15496 r15504  
    267267                </div>
    268268<?php
     269        }
     270
     271        /** Display a comment count bubble
     272         *
     273         *
     274         * @since 3.1.0
     275         * @access protected
     276         *
     277         * @param int $post_id
     278         * @param int $pending_comments
     279         */
     280        function comments_bubble( $post_id, $pending_comments ) {
     281                $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
     282
     283                if ( $pending_comments )
     284                        echo '<strong>';
     285
     286                $link = "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>%s</span></a>";
     287
     288                comments_number(
     289                        sprintf( $link, /* translators: comment count link */ _x( '0', 'comment count' ) ),
     290                        sprintf( $link, /* translators: comment count link */ _x( '1', 'comment count' ) ),
     291                        sprintf( $link, /* translators: comment count link: % will be substituted by comment count */ _x( '%', 'comment count' ) )
     292                );
     293
     294                if ( $pending_comments )
     295                        echo '</strong>';
    269296        }
    270297
Note: See TracChangeset for help on using the changeset viewer.