__( 'Ticker Widget which shows the text as it were received via a slow modem connection', 'retrogeek' ) ) ); } /** * Function to display the widget. * * @param array $args - constains the widget arguments. * @param array $instance - contains the instance variables of the widget. */ public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); $tickertext = apply_filters( 'widget_title', $instance['tickertext'] ); $allowed_tags = wp_kses_allowed_html( 'post' ); // before and after widget arguments are defined by themes. echo wp_kses( $args['before_widget'], $allowed_tags ); if ( ! empty( $title ) ) { echo wp_kses( $args['before_title'] . esc_attr( $title ) . $args['after_title'], $allowed_tags ); } // Add the tickertext and ticker call. if ( ! empty( $tickertext ) ) { echo '

'; // add the ticker javascript and execution. wp_add_inline_script( 'retrogeek-javascript', 'rg_terminal("' . esc_attr( $this->id ) . '", "' . esc_attr( $tickertext ) . '", "site-description, rg_tickertext" );', 'after' ); } echo wp_kses( $args['after_widget'], $allowed_tags ); } /** * Function to display the widget backend. * * @param array $instance - contains the instance variables of the widget. */ public function form( $instance ) { if ( isset( $instance['title'] ) ) { $title = $instance['title']; } else { $title = __( 'New title', 'retrogeek' ); } if ( isset( $instance['tickertext'] ) ) { $tickertext = $instance['tickertext']; } else { $tickertext = __( 'New tickertext', 'retrogeek' ); } // Widget admin form. ?>