From b7aa168e62d7bd6f1eb18fc6e20b18f1b0ff19cd Mon Sep 17 00:00:00 2001 From: ashubawork Date: Tue, 20 Jun 2023 09:53:04 +0300 Subject: [PATCH] - fix override templates --- includes/admin/core/class-admin-settings.php | 17 +++++++++++++++++ templates/account.php | 2 +- templates/gdpr-register.php | 2 +- templates/login.php | 2 +- templates/logout.php | 2 +- templates/members.php | 2 +- templates/message.php | 2 +- templates/password-change.php | 2 +- templates/password-reset.php | 2 +- templates/profile.php | 2 +- templates/register.php | 2 +- 11 files changed, 27 insertions(+), 10 deletions(-) diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index 6ab73b1d..43464555 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -3106,8 +3106,25 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { */ $located = apply_filters( "um_override_templates_get_template_path__{$key}", $located, $file ); + $exceptions = array( + 'members-grid.php', + 'members-header.php', + 'members-list.php', + 'members-pagination.php', + 'searchform.php', + 'login-to-view.php', + 'profile/comments.php', + 'profile/comments-single.php', + 'profile/posts.php', + 'profile/posts-single.php', + 'modal/um_upload_single.php', + 'modal/um_view_photo.php', + ); + if ( ! empty( $located ) ) { $theme_file = $located['theme']; + } elseif ( in_array( $file, $exceptions, true ) && file_exists( get_stylesheet_directory() . '/ultimate-member/' . $file ) ) { + $theme_file = get_stylesheet_directory() . '/ultimate-member/' . $file; } elseif ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/ultimate-member/templates/' . $file; } else { diff --git a/templates/account.php b/templates/account.php index a6ee074c..bfc3c8e6 100644 --- a/templates/account.php +++ b/templates/account.php @@ -2,7 +2,7 @@ /** * Template for the account page * - * This template can be overridden by copying it to yourtheme/ultimate-member/account.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/account.php * * Page: "Account" * diff --git a/templates/gdpr-register.php b/templates/gdpr-register.php index 786d1a8f..64202327 100644 --- a/templates/gdpr-register.php +++ b/templates/gdpr-register.php @@ -2,7 +2,7 @@ /** * Template for the GDPR checkbox in register form * - * This template can be overridden by copying it to yourtheme/ultimate-member/gdpr-register.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/gdpr-register.php * * Page: "Register" * Call: function display_option() diff --git a/templates/login.php b/templates/login.php index bc148c77..8423ee92 100644 --- a/templates/login.php +++ b/templates/login.php @@ -2,7 +2,7 @@ /** * Template for the login form * - * This template can be overridden by copying it to yourtheme/ultimate-member/login.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/login.php * * Page: "Login" * diff --git a/templates/logout.php b/templates/logout.php index 243aea8e..2857ab80 100644 --- a/templates/logout.php +++ b/templates/logout.php @@ -2,7 +2,7 @@ /** * Template for the logout * - * This template can be overridden by copying it to yourtheme/ultimate-member/logout.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/logout.php * * Page: "Logout" * diff --git a/templates/members.php b/templates/members.php index 2ba8da56..98b4521a 100644 --- a/templates/members.php +++ b/templates/members.php @@ -2,7 +2,7 @@ /** * Template for the members directory * - * This template can be overridden by copying it to yourtheme/ultimate-member/members.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/members.php * * Page: "Members" * diff --git a/templates/message.php b/templates/message.php index 271d89c7..d48a05de 100644 --- a/templates/message.php +++ b/templates/message.php @@ -2,7 +2,7 @@ /** * Template for the message after registration process * - * This template can be overridden by copying it to yourtheme/ultimate-member/message.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/message.php * * Call: function parse_shortcode_args() * diff --git a/templates/password-change.php b/templates/password-change.php index d3e178ac..0ecc4f03 100644 --- a/templates/password-change.php +++ b/templates/password-change.php @@ -2,7 +2,7 @@ /** * Template for the password change * - * This template can be overridden by copying it to yourtheme/ultimate-member/password-change.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/password-change.php * * Call: function ultimatemember_password() * diff --git a/templates/password-reset.php b/templates/password-reset.php index 57bf1686..e9ec2251 100644 --- a/templates/password-reset.php +++ b/templates/password-reset.php @@ -2,7 +2,7 @@ /** * Template for the password reset * - * This template can be overridden by copying it to yourtheme/ultimate-member/password-reset.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/password-reset.php * * Call: function ultimatemember_password() * diff --git a/templates/profile.php b/templates/profile.php index 32fe460f..3dedc659 100644 --- a/templates/profile.php +++ b/templates/profile.php @@ -2,7 +2,7 @@ /** * Template for the profile page * - * This template can be overridden by copying it to yourtheme/ultimate-member/profile.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/profile.php * * Page: "Profile" * diff --git a/templates/register.php b/templates/register.php index 5e614f00..255b8a1a 100644 --- a/templates/register.php +++ b/templates/register.php @@ -2,7 +2,7 @@ /** * Template for the register page * - * This template can be overridden by copying it to yourtheme/ultimate-member/register.php + * This template can be overridden by copying it to yourtheme/ultimate-member/templates/register.php * * Page: "Register" *