'https://www.candidthemes.com/themes/blockwp-pro/', ); return $theme_name; } public function blockwp_pro_theme_notice() { global $current_user; $this->current_user_data = $current_user; $this->active_theme = wp_get_theme(); $option = get_option( 'blockwp_theme_activate_start_time' ); if ( ! $option ) { update_option( 'blockwp_theme_activate_start_time', time() ); } add_action( 'admin_notices', array( $this, 'blockwp_pro_theme_notice_markup' ), 0 ); add_action( 'admin_init', array( $this, 'blockwp_pro_theme_notice_partial_ignore' ), 0 ); add_action( 'admin_init', array( $this, 'blockwp_pro_theme_notice_ignore' ), 0 ); } public function enqueue_scripts() { wp_enqueue_style( 'blockwp-notice', get_template_directory_uri() . '/candidthemes/notice/admin-notice.css', array(), '4.5.0' ); } public function blockwp_pro_theme_notice_markup() { $theme_name = self::get_theme(); $current_theme = strtolower( $this->active_theme ); $theme_notice_start_time = get_option( 'blockwp_theme_activate_start_time' ); $buy_before_questions = ( 'blockwp' !== $current_theme ) ? "https://www.candidthemes.com/contact/" : "https://www.candidthemes.com/contact/"; $ignore_notice_permanent = get_user_meta( $this->current_user_data->ID, 'blockwp_nag_blockwp_pro_theme_notice_ignore', true ); $ignore_notice_partially = get_user_meta( $this->current_user_data->ID, 'blockwp_nag_blockwp_pro_theme_notice_partial_ignore', true ); if ( ! array_key_exists( $current_theme, $theme_name ) ) { return; } if ( ( $theme_notice_start_time > strtotime( '-15 days' ) ) || ( $ignore_notice_partially > strtotime( '-5 days' ) ) || ( $ignore_notice_permanent ) ) { return; } ?>
' . esc_html__( 'unlock more features with pro theme', 'blockwp' ) . '';
printf(
esc_html__(
/* Translators: %1$s current user display name., %2$s Currently activated theme., %3$s Pro theme link., %4$s Coupon code. */
'Howdy, %1$s! You\'ve been using %2$s theme for a while now, and we hope you\'re happy with it. If you are looking for the premium features, you can %3$s. Moreover, you can use the coupon code %4$s to get 20 percent discount. Enjoy!', 'blockwp'
),
'' . esc_html( $this->current_user_data->display_name ) . '',
$this->active_theme,
$pro_link,
'offer20'
);
?>