[wp-trac] [WordPress Trac] #13169: Return Dynamic Sidebars with get_dynamic_sidebar

WordPress Trac noreply at wordpress.org
Wed Aug 8 04:42:46 UTC 2018


#13169: Return Dynamic Sidebars with get_dynamic_sidebar
-------------------------+------------------------------
 Reporter:  w3prodigy    |       Owner:  (none)
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Widgets      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by jobst):

 Since @SergeyBiryukov put it as "awaiting review" I have you included for
 review again.

 I, too, would like to have a function called "get_dynamic_sidebar",
 preferably as a core function so we do not get the overhead of the ob_*
 based functions.

 Alternatively there could be a flag added as parm for "dynamic_sidebar()"
 which stops the output but rather returns it.

 One of the obvious uses would be to scan for a string and replace:
 {{{
  $foobar=get_dynamic_sidebar('CopyrightNotice');
  $foobar=str_replace("%THEYEAR%",date('Y'),$foobar);
  echo $foobar;
 }}}
 Not sure why some core developers think this should not be implemented as
 it is pretty obvious to me if you want to dynamically replace content of a
 sidebar (or combine them as explained above).

 I have many websites that have a copyright notice in the footer that have
 a year in it. Easy to change when the content could be searched.

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


More information about the wp-trac mailing list