__( 'Add an AdPress ad to any widget box location.', ADPRESS_PREFIX ), ) ); } public function form( $instance ) { print __('Enter the ID or shorthand code for an ad.', ADPRESS_PREFIX); print $this->formatFormEntry($instance, 'id' , __( 'Ad ID:', ADPRESS_PREFIX) ,''); print $this->formatFormEntry($instance, 'shorthand' , __( 'Ad Shorthand:', ADPRESS_PREFIX) ,''); } public function update( $new_instance, $old_instance ) { return $new_instance; } public function widget( $args, $instance ) { print ADPRESS_UserInterface::render_shortcode($instance); } private function formatFormEntry($instance, $id,$label,$default) { $fldID = $this->get_field_id( $id ); $content= '
'. ''. 'get_field_name( $id ) .'" '. 'value="' .esc_attr( isset($instance[$id])?$instance[$id]:$default ) .'" '. '/>'. '
'; return $content; } }