Skip to content

Commit 887d4f6

Browse files
committed
Update Epsilon FW to latest version #218
1 parent 1dcd084 commit 887d4f6

File tree

3 files changed

+40
-61
lines changed

3 files changed

+40
-61
lines changed

inc/admin/welcome-screen/class-shapely-welcome.php

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
/**

inc/customizer.php

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -340,60 +340,6 @@ function shapely_customizer( $wp_customize ) {
340340
'section' => 'shapely_footer_section',
341341
) );
342342

343-
if ( class_exists( 'Epsilon_Control_Color_Scheme' ) ) {
344-
$wp_customize->add_setting( 'shapely_color_scheme', array(
345-
'sanitize_callback' => 'sanitize_text_field',
346-
'default' => 'default',
347-
'transport' => 'postMessage',
348-
) );
349-
350-
$wp_customize->add_control( new Epsilon_Control_Color_Scheme( $wp_customize, 'shapely_color_scheme', array(
351-
'label' => esc_html__( 'Color scheme', 'shapely' ),
352-
'description' => esc_html__( 'Select a color scheme', 'shapely' ),
353-
'choices' => array(
354-
array(
355-
'id' => 'purple',
356-
'name' => 'Default',
357-
'colors' => array(
358-
'accent' => '#745cf9',
359-
'text' => '#666666',
360-
'content-widget-title' => '#0e1015',
361-
'footer-bg' => '#0e1015',
362-
'footer-widget-title' => '#ffffff',
363-
'footer-links' => '#ffffff',
364-
),
365-
),
366-
array(
367-
'id' => 'yellow',
368-
'name' => 'Yellow',
369-
'colors' => array(
370-
'accent' => '#FFC107',
371-
'text' => '#666666',
372-
'content-widget-title' => '#0e1015',
373-
'footer-bg' => '#0e1015',
374-
'footer-widget-title' => '#ffffff',
375-
'footer-links' => '#ffffff',
376-
),
377-
),
378-
array(
379-
'id' => 'green',
380-
'name' => 'Green',
381-
'colors' => array(
382-
'accent' => '#2ecc71',
383-
'text' => '#666666',
384-
'content-widget-title' => '#0e1015',
385-
'footer-bg' => '#0e1015',
386-
'footer-widget-title' => '#ffffff',
387-
'footer-links' => '#ffffff',
388-
),
389-
),
390-
),
391-
'priority' => 0,
392-
'default' => 'purple',
393-
'section' => 'colors',
394-
) ) );
395-
} // End if().
396-
397343
$wp_customize->add_setting( 'title_in_header', array(
398344
'default' => 1,
399345
'sanitize_callback' => 'shapely_sanitize_checkbox',

inc/libraries/epsilon-framework

0 commit comments

Comments
 (0)