Skip to content

Instantly share code, notes, and snippets.

@drzippie
Created January 23, 2014 18:26
Show Gist options
  • Select an option

  • Save drzippie/8584070 to your computer and use it in GitHub Desktop.

Select an option

Save drzippie/8584070 to your computer and use it in GitHub Desktop.
theme-my-login-custom.php with custom template dir
<?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