rtsb()->pro_version_link(), 'global_check' => false, 'plugin_name' => 'ShopBuilder Pro', 'image_url' => rtsb()->get_assets_uri( 'images/shopbuilder-100x100.svg' ), 'option_name' => '', 'start_date' => '', 'end_date' => '', 'notice_for' => 'Cyber Monday Deal!!', 'notice_message' => '', ]; $options = apply_filters( 'rtsb_offer_notice', $this->the_options() ); $this->options = wp_parse_args( $options, $defaults ); $current = time(); $start = strtotime( $this->options['start_date'] ); $end = strtotime( $this->options['end_date'] ); if ( $this->options['global_check'] ) { return; } // Black Friday Notice. if ( ! rtsb()->has_pro() && $start <= $current && $current <= $end ) { if ( get_option( $this->options['option_name'] ) != '1' ) { if ( ! isset( $GLOBALS['rtsb__notice'] ) ) { $GLOBALS['rtsb__notice'] = 'rtsb__notice'; $this->offer_notice(); } } } } /** * Black Friday Notice. * * @return void */ private function offer_notice() { add_action( 'admin_enqueue_scripts', function () { wp_enqueue_script( 'jquery' ); } ); add_action( 'admin_notices', function () { ?>
<?php echo esc_attr( $this->options['plugin_name'] ); ?>

options['plugin_name'] ), esc_html( $this->options['notice_for'] ) ); ?>

options['notice_message'] ); ?>

Buy Now Dismiss

options['option_name'] ) ) { update_option( $this->options['option_name'], '1' ); } wp_die(); } ); } }