From 332332295711fd0e7dc1ee0db531fc9447df6d69 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Thu, 17 Aug 2023 01:14:47 +0300 Subject: [PATCH] - added required child-theme admin notice; --- includes/admin/core/class-admin-notices.php | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/includes/admin/core/class-admin-notices.php b/includes/admin/core/class-admin-notices.php index 72dd29eb..33ee01f4 100644 --- a/includes/admin/core/class-admin-notices.php +++ b/includes/admin/core/class-admin-notices.php @@ -53,6 +53,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { $this->template_version(); + $this->child_theme_required(); + // removed for now to avoid the bad reviews //$this->reviews_notice(); @@ -801,6 +803,35 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { } } + /** + * Check if there isn't installed child-theme. Child theme is required for safely saved customizations. + */ + public function child_theme_required() { + if ( ! is_child_theme() ) { + ob_start(); + ?> + +

+ child-theme for Ultimate Member customization, which hasn\'t dependencies with the official themes repo, so your custom files cannot be rewritten after a theme upgrade.
Otherwise, the customization files may be deleted after every theme upgrade.', 'ultimate-member' ), 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ), UM()->get_allowed_html( 'admin_notice' ) ); + ?> +

+ + admin()->notices()->add_notice( + 'um_is_not_child_theme', + array( + 'class' => 'notice-warning', + 'message' => $message, + 'dismissible' => true, + ), + 10 + ); + } + } + /** * First time installed Secure settings. */