defaults = array( 'title' => __( 'Author Details', 'advance-widget-pack' ), 'alignment' => 'left', 'user' => '', 'size' => '45', 'author_info' => 'bio', 'text-bio' => '', 'page' => '', 'page_link_text' => __( 'Read More', 'advance-widget-pack' ) . '…', 'posts_link' => '0', 'sort_radiobox' => 'bio', ); $widget_ops = array( 'classname' => 'awp_author_bio awp_widget', 'description' => __( 'Displays user profile block with Gravatar', 'advance-widget-pack' ), ); $control_ops = array( 'id_base' => 'author_bio', 'width' => 200, 'height' => 250, ); parent::__construct( 'author_bio', __( 'AWP Author Details', 'advance-widget-pack' ), $widget_ops, $control_ops ); } function widget( $args, $instance ) { $instance = wp_parse_args( (array) $instance, $this->defaults ); echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- sidebar-provided wrapper markup, trusted per WP core convention. echo '
'; echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- sidebar-provided wrapper markup, trusted per WP core convention. } function form( $instance ) { $instance = wp_parse_args( (array) $instance, $this->defaults ); ?>
'authors', 'name' => $this->get_field_name( 'user' ), 'selected' => $instance['user'] ) ); ?>
value="bio">
value="text">
$this->get_field_name( 'page' ), 'show_option_none' => __( 'None', 'advance-widget-pack' ), 'selected' => $instance['page'] ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_dropdown_pages() echoes its own already-escaped
id="get_field_id( 'posts_link' ) ); ?>" name="get_field_name( 'posts_link' ) ); ?>" />