'widget-about-author','description' => esc_html__( "Widget to author" ,'barletta') ); parent::__construct('barletta_about_author', esc_html__('Barletta About Author','barletta'), $widget_ops); } function widget($args , $instance) { extract($args); $title = isset($instance['title']) ? esc_html( $instance['title'] ) : esc_html__('About Me', 'barletta'); $name = isset($instance['name']) ? $instance['name'] : ''; $position = isset($instance['position']) ? $instance['position'] : ''; $body_content = isset($instance['body_content']) ? $instance['body_content'] : ''; $more_text_url = isset($instance['more_text_url']) ? $instance['more_text_url'] : ''; $attachment_style = $instance[ 'attachment_style' ] ? 'on' : 'off'; $attachment_id = isset($instance['attachment_id']) ? $instance['attachment_id'] : ''; $attachment_url = isset($instance['attachment_url']) ? $instance['attachment_url'] : ''; echo $before_widget; echo force_balance_tags($before_title.$title.$after_title); /** * Widget Content */ if( $name != '' ) { if ($attachment_id != "") { $attachmentID = $attachment_id; $imageSizeName = "barletta-author-thumbnail"; $img = wp_get_attachment_image_src($attachmentID, $imageSizeName); $imgsrc = $img[0]; } elseif ($attachment_url != "") { $imgsrc = $attachment_url; } if ($attachment_style == 'on') { $attachment_css = "rounded"; } else { $attachment_css = ""; } ?>
<?php echo esc_html($name); ?>

name="get_field_name( 'attachment_style' )); ?>" id="get_field_id( 'attachment_style' )); ?>" class="checkbox" />