Add Template Part Filters #21

Open
alexmansfield opened this Issue Aug 30, 2013 · 2 comments

2 participants

@alexmansfield

Any thoughts on adding filters to the arguments of get_template_part() to allow template parts to be selectively overridden? For example:

get_template_part( apply_filters( 'tha_template_part_slug', 'content' ), apply_filters( 'tha_template_part_name', get_post_format() ) );

This should allow child themes (and potentially plugins?) to specify exactly which template parts should be loaded under different circumstances.

@alexmansfield

I'm not sure I fully understand exactly what bbPress is doing, so I could easily be wrong. However, it seems that what bbPress is doing overrides template files loaded by WordPress (for example: index.php), not template parts loaded by the get_template_part() function (for example: content-quote.php). Is that correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment