@@ -12,9 +12,6 @@ public function __construct() {
1212 /* create dashbord page */
1313 add_action ( 'admin_menu ' , array ( $ this , 'shapely_welcome_register_menu ' ) );
1414
15- /* activation notice */
16- add_action ( 'load-themes.php ' , array ( $ this , 'shapely_activation_admin_notice ' ) );
17-
1815 /* enqueue script and style for welcome screen */
1916 add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'shapely_welcome_style_and_scripts ' ) );
2017
@@ -30,6 +27,16 @@ public function __construct() {
3027 $ this ,
3128 'shapely_dismiss_required_action_callback ' ,
3229 ) );
30+
31+ $ theme = wp_get_theme ();
32+ $ this ->theme_name = $ theme ->get ( 'Name ' );
33+ $ this ->theme_slug = $ theme ->get ( 'TextDomain ' );
34+
35+ /**
36+ * Add the notice in the admin backend
37+ */
38+ $ this ->shapely_activation_admin_notice ();
39+
3340 }
3441
3542 /**
@@ -54,11 +61,37 @@ public function shapely_welcome_register_menu() {
5461 * @since 1.8.2.4
5562 */
5663 public function shapely_activation_admin_notice () {
57- global $ pagenow ;
64+ if ( ! class_exists ( 'Epsilon_Notifications ' ) ) {
65+ return ;
66+ }
67+
68+ if ( empty ( $ this ->notice ) ) {
69+ $ this ->notice = '<img src=" ' . get_template_directory_uri () . '/inc/admin/welcome-screen/img/colorlib-logo-white2.png" class="epsilon-author-logo" /> ' ;
70+
71+ /* Translators: %1$s - Theme Name */
72+ $ this ->notice .= '<h1> ' . sprintf ( esc_html__ ( 'Welcome to %1$s ' , 'shapely ' ), $ this ->theme_name ) . '</h1> ' ;
73+ $ this ->notice .= '<p> ' ;
74+ $ this ->notice .=
75+ sprintf ( /* Translators: Notice */
76+ esc_html__ ( 'Welcome! Thank you for choosing %3$s! To fully take advantage of the best our theme can offer please make sure you visit our %1$swelcome page%2$s. ' , 'shapely ' ),
77+ '<a href=" ' . esc_url ( admin_url ( 'themes.php?page= ' . $ this ->theme_slug . '-welcome ' ) ) . '"> ' ,
78+ '</a> ' ,
79+ $ this ->theme_name
80+ );
81+ $ this ->notice .= '</p> ' ;
82+ /* Translators: %1$s - Theme Name */
83+ $ this ->notice .= '<p><a href=" ' . esc_url ( admin_url ( 'themes.php?page= ' . $ this ->theme_slug . '-welcome ' ) ) . '" class="button button-primary button-hero" style="text-decoration: none;"> ' . sprintf ( esc_html__ ( 'Get started with %1$s ' , 'shapely ' ), $ this ->theme_name ) . '</a></p> ' ;
5884
59- if ( is_admin () && ( 'themes.php ' == $ pagenow ) && isset ( $ _GET ['activated ' ] ) ) {
60- add_action ( 'admin_notices ' , array ( $ this , 'shapely_welcome_admin_notice ' ), 99 );
6185 }
86+
87+ $ notifications = Epsilon_Notifications::get_instance ();
88+ $ notifications ->add_notice (
89+ array (
90+ 'id ' => 'shapely_install_notice ' ,
91+ 'type ' => 'notice epsilon-big ' ,
92+ 'message ' => $ this ->notice ,
93+ )
94+ );
6295 }
6396
6497 /**
0 commit comments