Last active
February 13, 2018 19:28
-
-
Save eudesgit/a6aff39d2cbbcd2378327faccaf2ff73 to your computer and use it in GitHub Desktop.
How to make outside the theme page templates available for use
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 | |
/** | |
* theme_page_templates Filter callback | |
* | |
* Merges plugins' template with theme's, making them available for the user | |
* | |
* @param array $theme_templates | |
* @return array $theme_templates | |
*/ | |
function register_plugin_templates ( $theme_templates ) { | |
// Merging the WP templates with this plugin's active templates | |
$theme_templates = array_merge($theme_templates, $this->templates); | |
return $theme_templates; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment