* @license GPL 2+ GNU GPL licence above 2+ * @link http://anspress.io * @since 2.0.0-alpha2 * */ // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { die; } class AnsPress_Subscribe_Widget extends WP_Widget { /** * Initialize the class */ public function __construct() { parent::__construct( 'ap_subscribe_widget', __( '(AnsPress) Subscribe', 'anspress-question-answer' ), array( 'description' => __( 'Subscribe button for single question and terms page.', 'anspress-question-answer' ) ) ); } public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', @$instance['title'] ); echo $args['before_widget']; if ( ! empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } echo '
'; ap_subscribe_btn_html(); ap_question_subscribers(); echo '
'; echo $args['after_widget']; } public function form( $instance ) { if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = __( 'Subscribe', 'anspress-question-answer' ); } ?>