GaryJones / Gamajo-Template-Loader

A class to copy into your WordPress plugin, to allow loading template parts with fallback through the child theme > parent theme > plugin.
GNU General Public License v2.0
292 stars 61 forks source link

namespace get_template_part action hook #24

Closed cliffordp closed 7 years ago

cliffordp commented 8 years ago

Example: action hook is now get_template_part_tk_event_weather_hourly_horizontal instead of just get_template_part_hourly_horizontal

GaryJones commented 8 years ago

Can you please give the use case for this?

(As it stands, this will break backwards-compatibility.)

cliffordp commented 8 years ago

If this is my template: /wp-admin/plugins/tk-event-weather/includes/templates/hourly_horizontal.php

the unique part of the action hook is simply hourly_horizontal --> get_template_part_hourly_horizontal

What if another plugin uses your class and has the same template name?

A workaround could be to name the templates with a prefix, like

But that doesn't feel right.

Let me know if any additional clarification is needed.

Thanks!

GaryJones commented 7 years ago

Closing in favour of #25.