From 14b4c9989f92fbf2e2856e2a857a8946e8b7acd4 Mon Sep 17 00:00:00 2001 From: Champ Camba Date: Fri, 13 Dec 2019 12:01:20 +0800 Subject: [PATCH] Allow GDPR template to get overwritten in the theme directory --- includes/core/class-gdpr.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/core/class-gdpr.php b/includes/core/class-gdpr.php index 8bb9d3a0..7f12c626 100644 --- a/includes/core/class-gdpr.php +++ b/includes/core/class-gdpr.php @@ -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'; + } } + }