Created
January 23, 2014 18:26
-
-
Save drzippie/8584070 to your computer and use it in GitHub Desktop.
theme-my-login-custom.php with custom template dir
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-my-login-custom.php | |
| */ | |
| /** | |
| * Cambiamos las plantillas por unas propias | |
| * @param string $useTemplate Plantilla encontrada | |
| * @param array $templates Plantillas buscadas | |
| * @return string Plantilla a usar | |
| */ | |
| function tml_template( $useTemplate, $templates ) { | |
| foreach( $templates as $template) { | |
| if (file_exists( TEMPLATEPATH . '/login/' . $template )) { | |
| $useTemplate = TEMPLATEPATH . '/login/' . $template ; | |
| break; | |
| } | |
| } | |
| return $useTemplate ; | |
| } | |
| add_filter( 'tml_template', 'tml_template', 10, 3 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment