Allow GDPR template to get overwritten in the theme directory

This commit is contained in:
Champ Camba
2019-12-13 12:01:20 +08:00
parent 9b90f1c37d
commit 14b4c9989f
+10 -1
View File
@@ -32,9 +32,18 @@ if ( ! class_exists( 'um\core\GDPR' ) ) {
* @param $args
*/
function display_option( $args ) {
if ( isset( $args['use_gdpr'] ) && $args['use_gdpr'] == 1 ) {
require um_path . 'templates/gdpr-register.php';
$template_path = trailingslashit( get_stylesheet_directory() ). '/ultimate-member/templates/gdpr-register.php';
if ( file_exists( $template_path ) ) {
require $template_path;
} else {
require um_path . 'templates/gdpr-register.php';
}
}
}