1 | | It would be interesting to provide a generic filter that would apply to any $type. |
2 | | I'm trying create WordPress themes using client side frameworks (starting with AngularJS) and I need to recreate the locate_template logic on the client-side. This implies to always send the complete $templates array generated by get_query_template. |
| 1 | I'm trying to recreate the template hierarchy logic on a client side with AngularJS. I want client-side templates to be picked by the Angular router based on current path and naming convention using the same rules that are used by WordPress on the server side. |
| 2 | |
| 3 | The easiest way to achieve this is to get the computed array of $templates from the server side whenever the location path changes on the client side, then check which client-side template fits. |
| 4 | |
| 5 | This implies that a generic filter inside get_category_template can provide the $templates array corresponding to any $type. |
| 6 | Unfortunately I see no alternative to this filter, and if it doesn't make it in 3.6, I will have to write a plugin that overwrites the content of wp-includes/template.php. I know this is a bad practice but there is simply no other way that I can think of. |