', $this->get_field_id( 'cta_img' ), esc_html__( 'Image Url Here', 'ac-repair' ), $this->get_field_name( 'cta_img' ), esc_attr( $cta_img ) ); $cta_content = isset( $instance['cta_content'] ) ? $instance['cta_content'] : '

Get started now!

Schedule your next appointment with one of our technicians today.

Schedule appointment
'; $cta_content = esc_html( $cta_content ); printf( '


', $this->get_field_id( 'cta_content' ), esc_html__( 'Enter Cta Content', 'ac-repair' ), $this->get_field_name( 'cta_content' ), esc_attr( $cta_content ) ); } /** * Renders the output. * * @see WP_Widget::widget() */ public function widget( $args, $instance ){ // Widget output extract($args); $cta_img = isset( $instance['cta_img'] ) ? $instance['cta_img'] : esc_url('https://placeholdit.imgix.net/~text?txtsize=33&txt=358%C3%97282&w=358&h=282'); $cta_img = !empty( $cta_img ) ? esc_url( $cta_img ) : esc_url('https://placeholdit.imgix.net/~text?txtsize=33&txt=358%C3%97282&w=358&h=282'); $cta_content = isset( $instance['cta_content'] ) ? $instance['cta_content'] : ''; printf('

ac company
%2$s
', $cta_img, $cta_content ); } /** * Prepares the content. Not. * * @param array $new_instance New content * @param array $old_instance Old content * @return array New content */ public function update( $new_instance, $old_instance ){ $new_instance_array = array( 'cta_img', 'cta_heading', 'cta_content', 'cta_btn' ); foreach( $new_instance_array as $val ) $old_instance[ $val ] = $new_instance[ $val ]; return $old_instance; } /** * Tell WP we want to use this widget. * * @wp-hook widgets_init * @return void */ public static function register(){ register_widget( __CLASS__ ); } }