Last active
June 5, 2020 12:35
-
-
Save wp-user-manager/57b18f07263f4a32e6df97c7bd4041d0 to your computer and use it in GitHub Desktop.
WP User Manager - Register a directory for templates in plugins or other code
This file contains 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 | |
/** | |
* @param array $file_paths | |
* | |
* @return array | |
*/ | |
function my_wpum_register_template_location( $file_paths ) { | |
$path = trailingslashit( dirname( __FILE__ ) . 'templates' ); | |
// Add template path first as a higher priority to the core plugin and theme | |
array_unshift( $file_paths, $path ); | |
return $file_paths; | |
} | |
add_filter( 'wpum_template_paths', 'my_wpum_register_template_location' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment