* @license GPL 3+ GNU GPL licence above 3+ * @link https://anspress.io * @since 2.0.0 */ // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { die; } /** * Ask from widget. */ class AP_Askform_Widget extends WP_Widget { /** * Initialize the class */ public function __construct() { parent::__construct( 'ap_askform_widget', __( '(AnsPress) Ask form', 'anspress-question-answer' ), array( 'description' => __( 'AnsPress ask form widget', 'anspress-question-answer' ) ) ); } /** * Render widget. * * @param array $args Arhuments. * @param array $instance Instance. * @return void */ public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); echo $args['before_widget']; // xss okay. if ( ! empty( $title ) ) { echo $args['before_title'] . esc_html( $title ) . $args['after_title']; // xss okay. } wp_enqueue_script( 'anspress-main' ); ?>