[wp-trac] [WordPress Trac] #36424: graphically visualize if comments are closed (in wp-admin/edit.php)

WordPress Trac noreply at wordpress.org
Sun Apr 10 00:54:25 UTC 2016


#36424: graphically visualize if comments are closed (in wp-admin/edit.php)
----------------------------+---------------------------------
 Reporter:  pixelverbieger  |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Comments        |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  ui, administration
----------------------------+---------------------------------

Comment (by Presskopp):

 Latest brainstorming, at least it's working..

 I thought if we show a locked lock we can also switch to an open lock if
 comments are allowed. And why not change the boring mdash for a sexy X ?
 ;-)
 Another interesting dashicon candidate would be 'dashicons-welcome-
 comments':
 [https://developer.wordpress.org/resource/dashicons/#welcome-comments]

 Still not sure about how to deal with translations here.

 And I ask myself where core ends and plugins territory begins.

 However, here something to play around:
 {{{#!php
                 // If comments are closed, show a lock then
                 if ( ! comments_open( $post_id ) ) {
                         printf( '<span aria-hidden="true"><span
 class="dashicons dashicons-lock"></span></span><span class="screen-reader-
 text">%s</span>',
                                 __( 'Comments are closed' )
                         );
                 }
                 // Comments are allowed, show open lock
                 else {
                         printf( '<span aria-hidden="true"><span
 class="dashicons dashicons-unlock"></span></span><span class="screen-
 reader-text">%s</span>',
                                 __( 'Comments are allowed' )
                         );
                 }
                 // No comments at all, show X icon instead of mdash
                 if ( ! $approved_comments && ! $pending_comments ) {
                         printf( '<span aria-hidden="true"><span
 class="dashicons dashicons-no-alt"></span></span><span class="screen-
 reader-text">%s</span>',
                                 __( 'No comments' )
                         );

 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36424#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list