[wp-trac] [WordPress Trac] #27156: add filter to manipulate $before_title and $after_title in widget

WordPress Trac noreply at wordpress.org
Fri Feb 21 19:46:00 UTC 2014


#27156: add filter to manipulate $before_title and $after_title in widget
-------------------------------+------------------------------
 Reporter:  sireneweb          |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Widgets            |     Version:  3.8.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by ocean90):

 * keywords:   => reporter-feedback
 * type:  feature request => enhancement


Comment:

 Hello sireneweb, thanks for your report.

 Why do you want to change $before_title and $after_title? Looking at your
 example your are just changing the class name, probably for styling
 purposes. A sidebar can also register $before_widget which includes an ID
 and a class name.

 Based on your example something like the following should work too:

 {{{
 .widget-title {
     color: blue;
 }

 #nav_menu-6 .widget-title,
 #nav_menu-2 .widget-title,
 #nav_menu-5 .widget-title,
 #categories-2 .widget-title {
     color: green;
 }

 .custom_post_widget .widget-title {
     color: red;
 }
 }}}

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


More information about the wp-trac mailing list