Page Templater For Elementor - Version 1.2.8

Version Description

  • 2018-11-29
Download this release

Release Info

Developer themeisle
Plugin Icon wp plugin Page Templater For Elementor
Version 1.2.8
Comparing to
See all releases

Code changes from version 1.2.7 to 1.2.8

CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
 
 
 
 
 
2
  ### v1.2.7 - 2018-11-27
3
  **Changes:**
4
  * Update recommended theme link
1
 
2
+ ### v1.2.8 - 2018-11-29
3
+ **Changes:**
4
+ * Fix possible issue with multiple notices
5
+
6
  ### v1.2.7 - 2018-11-27
7
  **Changes:**
8
  * Update recommended theme link
elementemplater-class.php CHANGED
@@ -28,12 +28,9 @@ class ElemenTemplater {
28
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ), 998 );
29
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 9999 );
30
 
31
- $current_theme = wp_get_theme();
32
- $theme_name = $current_theme->get( 'TextDomain' );
33
- $template = $current_theme->get( 'Template' );
34
- if ( $theme_name !== 'neve' && $template !== 'neve' ) {
35
- add_action( 'admin_notices', array($this, 'simple_notice') );
36
- add_action( 'admin_init', array($this, 'elementemplater_dismiss_notice') );
37
  }
38
  }
39
 
@@ -68,45 +65,6 @@ class ElemenTemplater {
68
  wp_enqueue_script( 'builder-fullwidth-js', plugins_url( 'assets/custom.js', __FILE__ ), array( 'jquery' ), '', true );
69
  }
70
  }
71
-
72
- public function simple_notice() {
73
- global $current_user;
74
- $user_id = $current_user->ID;
75
- $ignored_notice = get_user_meta( $user_id, 'elementemplater_ignore_neve_notice' );
76
-
77
- if ( ! empty( $ignored_notice ) ) {
78
- return;
79
- }
80
-
81
- $dismiss_button = sprintf(
82
- '<a href="%s" class="notice-dismiss" style="text-decoration:none;"></a>',
83
- '?elementemplater_ignore_notice=0'
84
- );
85
-
86
- $message = sprintf(
87
- esc_html__( 'Do you enjoy working with Elementor? %1$s %2$s', 'elementor-templater' ),
88
- sprintf( '<br>Page Templater For Elementor recommends <strong>Neve</strong>, our new <strong>FREE multipurpose theme</strong>. It\'s simple, fast and fully compatible with both Elementor and Gutenberg. See the' ),
89
- sprintf(
90
- '<a target="_blank" href="%1$s">%2$s</a>',
91
- esc_url( admin_url( 'theme-install.php?theme=neve' ) ),
92
- esc_html__( 'live preview.', 'elementor-templater' )
93
- )
94
- );
95
-
96
- printf(
97
- '<div class="notice updated" style="position:relative;">%1$s<p>%2$s</p></div>',
98
- $dismiss_button,
99
- $message
100
- );
101
- }
102
-
103
- public function elementemplater_dismiss_notice() {
104
- global $current_user;
105
- $user_id = $current_user->ID;
106
- if ( isset( $_GET['elementemplater_ignore_notice'] ) && '0' == $_GET['elementemplater_ignore_notice'] ) {
107
- add_user_meta( $user_id, 'elementemplater_ignore_neve_notice', 'true', true );
108
- }
109
- }
110
  }
111
 
112
  add_action( 'plugins_loaded', array( 'ElemenTemplater', 'get_instance' ) );
28
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ), 998 );
29
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 9999 );
30
 
31
+ if ( ! class_exists( 'Ti_Upsell_Notice_Manager' ) ) {
32
+ require ET_PATH . 'inc/class-ti-upsell-notice-manager.php';
33
+ add_action( 'init', array( Ti_Upsell_Notice_Manager::instance(), 'init' ) );
 
 
 
34
  }
35
  }
36
 
65
  wp_enqueue_script( 'builder-fullwidth-js', plugins_url( 'assets/custom.js', __FILE__ ), array( 'jquery' ), '', true );
66
  }
67
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
 
70
  add_action( 'plugins_loaded', array( 'ElemenTemplater', 'get_instance' ) );
elementemplator.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Page Templater For Elementor
4
  * Plugin URI: https://themeisle.com/
5
  * Description: A helper plugin for users of Elementor Pagebuilder. Adds 2 new templates for complete full width experience while using the page builder - support for a number of popular themes is built-in.
6
- * Version: 1.2.7
7
  * Author: ThemeIsle
8
  * Author URI: https://themeisle.com/
9
  * Requires at least: 4.4
@@ -22,7 +22,7 @@ if ( ! defined( 'WPINC' ) ) {
22
  ------------------------------------------ */
23
 
24
  /* Set plugin version constant. */
25
- define( 'ET_VERSION', '1.2.7' );
26
 
27
  /* Set constant path to the plugin directory. */
28
  define( 'ET_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
3
  * Plugin Name: Page Templater For Elementor
4
  * Plugin URI: https://themeisle.com/
5
  * Description: A helper plugin for users of Elementor Pagebuilder. Adds 2 new templates for complete full width experience while using the page builder - support for a number of popular themes is built-in.
6
+ * Version: 1.2.8
7
  * Author: ThemeIsle
8
  * Author URI: https://themeisle.com/
9
  * Requires at least: 4.4
22
  ------------------------------------------ */
23
 
24
  /* Set plugin version constant. */
25
+ define( 'ET_VERSION', '1.2.8' );
26
 
27
  /* Set constant path to the plugin directory. */
28
  define( 'ET_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
inc/class-ti-upsell-notice-manager.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Notice manager for Neve upsell.
4
+ */
5
+
6
+ /**
7
+ * Class Ti_Upsell_Notice_Manager
8
+ */
9
+ class Ti_Upsell_Notice_Manager {
10
+
11
+ /**
12
+ * Singleton object.
13
+ *
14
+ * @var null Instance object.
15
+ */
16
+ protected static $instance = null;
17
+
18
+ /**
19
+ * Dismiss option key.
20
+ *
21
+ * @var string Dismiss option key.
22
+ */
23
+ protected static $dismiss_key = 'neve_upsell_off';
24
+
25
+ /**
26
+ * Init the OrbitFox instance.
27
+ *
28
+ * @return Orbit_Fox_Neve_Dropin|null
29
+ */
30
+ public static function instance() {
31
+ if ( is_null( self::$instance ) ) {
32
+ self::$instance = new self();
33
+ self::$instance->init();
34
+ }
35
+
36
+ return self::$instance;
37
+ }
38
+
39
+ /**
40
+ * Drop-in actions
41
+ */
42
+ public function init() {
43
+ add_action( 'admin_notices', array( $this, 'admin_notice' ), defined( 'PHP_INT_MIN' ) ? PHP_INT_MIN : 99999 );
44
+ add_action( 'admin_init', array( $this, 'remove_notice' ), defined( 'PHP_INT_MIN' ) ? PHP_INT_MIN : 99999 );
45
+ }
46
+
47
+ /**
48
+ * Add notice.
49
+ */
50
+ public function admin_notice() {
51
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
52
+ return;
53
+ }
54
+ if ( is_network_admin() ) {
55
+ return;
56
+ }
57
+ if ( ! current_user_can( 'manage_options' ) ) {
58
+ return;
59
+ }
60
+ if ( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) {
61
+ return;
62
+ }
63
+
64
+ $current_theme = wp_get_theme();
65
+ $theme_name = $current_theme->get( 'TextDomain' );
66
+ $template = $current_theme->get( 'Template' );
67
+ if ( $theme_name === 'neve' || $template === 'neve' ) {
68
+ return;
69
+ }
70
+
71
+ /**
72
+ * Backwards compatibility.
73
+ */
74
+ global $current_user;
75
+ $user_id = $current_user->ID;
76
+ $ignored_notice = get_user_meta( $user_id, 'elementemplater_ignore_neve_notice' );
77
+ if ( ! empty( $ignored_notice ) ) {
78
+ update_option( self::$dismiss_key, 'yes' );
79
+ }
80
+
81
+ if ( get_option( self::$dismiss_key, 'no' ) === 'yes' ) {
82
+ return;
83
+ }
84
+
85
+ $dismiss_button = sprintf(
86
+ '<a href="%s" class="notice-dismiss" style="text-decoration:none;"></a>',
87
+ wp_nonce_url( add_query_arg( array( self::$dismiss_key => 'yes' ) ), 'remove_upsell_confirmation', 'remove_upsell' )
88
+ );
89
+
90
+ $message = sprintf(
91
+ esc_html__( 'Do you enjoy working with Elementor? %1$s %2$s', 'elementor-templater' ),
92
+ sprintf( '<br>Page Templater For Elementor recommends <strong>Neve</strong>, our new <strong>FREE multipurpose theme</strong>. It\'s simple, fast and fully compatible with both Elementor and Gutenberg. See the' ),
93
+ sprintf(
94
+ '<a target="_blank" href="%1$s">%2$s</a>',
95
+ esc_url( admin_url( 'theme-install.php?theme=neve' ) ),
96
+ esc_html__( 'live preview.', 'elementor-templater' )
97
+ )
98
+ );
99
+
100
+ printf(
101
+ '<div class="notice updated" style="position:relative;">%1$s<p>%2$s</p></div>',
102
+ $dismiss_button,
103
+ $message
104
+ );
105
+ }
106
+
107
+ /**
108
+ * Remove notice;
109
+ */
110
+ public function remove_notice() {
111
+ if ( ! isset( $_GET[ self::$dismiss_key ] ) ) {
112
+ return;
113
+ }
114
+ if ( $_GET[ self::$dismiss_key ] !== 'yes' ) {
115
+ return;
116
+ }
117
+ if ( ! isset( $_GET['remove_upsell'] ) ) {
118
+ return;
119
+ }
120
+ if ( ! wp_verify_nonce( $_GET['remove_upsell'], 'remove_upsell_confirmation' ) ) {
121
+ return;
122
+ }
123
+ update_option( self::$dismiss_key, 'yes' );
124
+ }
125
+
126
+ /**
127
+ * Deny clone.
128
+ */
129
+ public function __clone() {
130
+ }
131
+
132
+ /**
133
+ * Deny un-serialize.
134
+ */
135
+ public function __wakeup() {
136
+ }
137
+ }
readme.md CHANGED
@@ -130,6 +130,11 @@ Further details will be available near the time of the release.
130
  2. Fullwidth no Header no Footer
131
 
132
  ## Changelog ##
 
 
 
 
 
133
  ### 1.2.7 - 2018-11-27 ###
134
 
135
  * Update recommended theme link
130
  2. Fullwidth no Header no Footer
131
 
132
  ## Changelog ##
133
+ ### 1.2.8 - 2018-11-29 ###
134
+
135
+ * Fix possible issue with multiple notices
136
+
137
+
138
  ### 1.2.7 - 2018-11-27 ###
139
 
140
  * Update recommended theme link
readme.txt CHANGED
@@ -130,6 +130,11 @@ Further details will be available near the time of the release.
130
  2. Fullwidth no Header no Footer
131
 
132
  == Changelog ==
 
 
 
 
 
133
  = 1.2.7 - 2018-11-27 =
134
 
135
  * Update recommended theme link
130
  2. Fullwidth no Header no Footer
131
 
132
  == Changelog ==
133
+ = 1.2.8 - 2018-11-29 =
134
+
135
+ * Fix possible issue with multiple notices
136
+
137
+
138
  = 1.2.7 - 2018-11-27 =
139
 
140
  * Update recommended theme link
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"custom-posttype-class.php":"3fde4cfce9b92dbabb408eb375d12ab2","elementemplater-class.php":"e035c0c012a8fc7d76e7df8af765bd74","elementemplator.php":"9a0d059ebee0e82d397b19858f027946"}
1
+ {"custom-posttype-class.php":"3fde4cfce9b92dbabb408eb375d12ab2","elementemplater-class.php":"6c46d2070122292e45b6673f2a5607c0","elementemplator.php":"9ec5440c4d0271f5b356418c2c7d4b23"}