[wp-trac] [WordPress Trac] #26571: Increase flexibility of "At a Glance" Dashboard Widget to match "Right Now" Widget

WordPress Trac noreply at wordpress.org
Fri Jun 3 16:41:11 UTC 2016


#26571: Increase flexibility of "At a Glance" Dashboard Widget to match "Right Now"
Widget
-------------------------------------------------+-------------------------
 Reporter:  mrwweb                               |       Owner:  chriscct7
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
Component:  Administration                       |  Release
 Severity:  normal                               |     Version:  3.8
 Keywords:  has-patch needs-testing needs-       |  Resolution:
  refresh                                        |     Focuses:  docs
-------------------------------------------------+-------------------------

Comment (by zodiac1978):

 Sorry, but I don't know why we need the class here.

 With a new list item I can use a custom class within a link/span/etc. via
 CSS code like this to change the (dash)icon:

 `#dashboard_right_now .custom-class:before { dashicon css code }`

 We can't just use classes like `dashicons dashicons-info` here, because
 the admin css is providing a dashicon for every span and link too and the
 dashicons class at the `li`-item would change the font-family for the
 list-item content to the dashicon font.

 But I thought it wa sthe intention to change the icon and it would be
 great time saver if we could use the dashicon classes here, but this isn't
 possible, because of the before mentioned reasons.

 So I don't think the patch is helping us here, as we can use the same with
 code like that:

 {{{
 function add_to_glance( Array $items ) {

     $items[] = '<a class="custom-class"
 href="http://google.de">Google</a>';
     return $items;

 add_filter( 'dashboard_glance_items', 'add_to_glance' );
 }}}

 {{{
 #dashboard_right_now .custom-class:before {
         color: orange;
         content: "\f348";
 }

 }}}

 Unfortunately we need a CSS block or file to do that, because we can't use
 `:before` in style attribute.

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


More information about the wp-trac mailing list