You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In eo_locate_template() there's a wonderful way to override theme templates. Unfortunately, the loop for locating the template files fails on the line after which $located is defined: it breaks only the first foreach, not the entire loop. This results in the loop always searching for the last $template_name, even when a higher prioritized template file was already found before.
Hi @lmoffereins - good spot, but do have an actual example of this? The plug-in uses just passes one template name, and the few exceptions where it passes an array, the latter template names do not exist (e.g. widget-event-list.php exists, but event-list.php does not).
@stephenharris While your plugin functions just fine on its own, I'm using eo_locate_template() in my plugin to extend EO itself. There I'd like to provide a set of template naming options, similar to how bbPress uses its templating system. This would allow authors of themes or other plugins to choose their own template specificity while also providing the opton to fallback to EO's own templates.
In
eo_locate_template()
there's a wonderful way to override theme templates. Unfortunately, the loop for locating the template files fails on the line after which$located
is defined: it breaks only the firstforeach
, not the entire loop. This results in the loop always searching for the last$template_name
, even when a higher prioritized template file was already found before.Suggested fix: apply
break 2;
instead of justbreak;
directly after locating the template file.Easy win!
The text was updated successfully, but these errors were encountered: