Skip to content

Commit 97e8f99

Browse files
authored
Merge pull request #855 from Codeinwp/feat/themeisle-1676
Hide SDK random promo notice
2 parents 160f394 + be83492 commit 97e8f99

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

inc/main.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static function instance() {
9292

9393
if ( null === self::$_instance ) {
9494
add_filter( 'themeisle_sdk_products', [ __CLASS__, 'register_sdk' ] );
95-
add_filter( 'themeisle_sdk_ran_promos', '__return_true' );
95+
add_filter( 'themeisle_sdk_ran_promos', [ __CLASS__, 'sdk_hide_promo_notice' ] );
9696
add_filter( 'optimole-wp_uninstall_feedback_icon', [ __CLASS__, 'change_icon' ] );
9797
add_filter( 'optimole_wp_uninstall_feedback_after_css', [ __CLASS__, 'adds_uf_css' ] );
9898
add_filter( 'optimole_wp_feedback_review_message', [ __CLASS__, 'change_review_message' ] );
@@ -246,4 +246,19 @@ public function __clone() {
246246
public function __wakeup() {
247247
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'optimole-wp' ), '1.0.0' );
248248
}
249+
250+
/**
251+
* Hide SDK promo notice for pro uses.
252+
*
253+
* @access public
254+
*/
255+
public static function sdk_hide_promo_notice() {
256+
if ( self::$_instance->admin->settings->is_connected() ) {
257+
$service_data = self::$_instance->admin->settings->get( 'service_data' );
258+
if ( isset( $service_data['plan'] ) && 'free' !== $service_data['plan'] ) {
259+
return false;
260+
}
261+
}
262+
return true;
263+
}
249264
}

0 commit comments

Comments
 (0)