Allow Obj->__toString() in template heirarchy filter

This commit is contained in:
QWp6t
2016-07-14 15:15:15 -07:00
parent 4435d52d01
commit 8ee444d7b7

View File

@@ -46,7 +46,7 @@ add_filter('excerpt_more', function () {
* Use theme wrapper
*/
add_filter('template_include', function ($main) {
if (!is_string($main) || !(string) $main) {
if (!is_string($main) || !(is_object($main) && method_exists($main, '__toString'))) {
return $main;
}
return template_wrap(new Wrapper($main));