Created
October 27, 2014 23:27
-
-
Save khromov/f30789cd35297c41bb04 to your computer and use it in GitHub Desktop.
Include theme templates from plugin, WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Helper function for including templates | |
* | |
* @param $template | |
*/ | |
function include_template($template, $args) | |
{ | |
extract($args); | |
if(locate_template($template) === '') | |
include 'templates/' . $template; | |
else | |
include locate_template($template); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment