[wp-trac] [WordPress Trac] #40258: Add hook for get_template_part

WordPress Trac noreply at wordpress.org
Sat Mar 25 09:52:55 UTC 2017


#40258: Add hook for get_template_part
-------------------------+-----------------------------
 Reporter:  tazotodua    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Themes       |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 We frequently use themes, which themselves use
 `get_template_part('smth1/smth2')`

 however, i many cases, we want (from custom plugin) to avoid inclusion of
 specific template parts.

 there seems no solution, rather than manually modifying themes inner code
 to avoid getting that particular template part.

 It will be better if there was a hook:

 function get_template_part( $slug, $name = null ) {

     .....
     $slug =apply_filters('get_template_part_filter', $slug, $name);
     if(empty($slug)) return;
     ........

 }

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40258>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list