[wp-trac] [WordPress Trac] #35475: New functions: `current_widget` and `current_widget_id`

WordPress Trac noreply at wordpress.org
Mon Jan 18 09:47:22 UTC 2016


#35475: New functions: `current_widget` and `current_widget_id`
------------------------------+------------------------------
 Reporter:  sebastian.pisula  |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Widgets           |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+------------------------------

Comment (by sebastian.pisula):

 Other example: I have widget Recent Posts. In current widget is title +
 date. But I need "date + excerpt". So in widget settings disable show date
 and add filter for the_title and if check:
 {{{#!php
 <?php

 if(current_widget() == 'recent_posts'){
 return 'date '. title;
 }

 return $title;
 }}}

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


More information about the wp-trac mailing list