'bestblog_author_widget', 'description' => __('Use this widget to display author/user profile info', 'best-blog') ,'customize_selective_refresh' => true); $control_ops = array( 'id_base' => 'bestblog_author_widget' ); parent::__construct('bestblog_author_widget', __('bestblog Author Bio', 'best-blog'), $widget_ops, $control_ops); //Allow themes or plugins to modify default parameters $defaults = apply_filters('bestblog_author_widget_modify_defaults', array( 'title' => esc_attr__('CEO / Co-Founder', 'best-blog'), 'author' => 0, 'display_avatar' => 1, 'display_desc' => 1, 'display_all_posts' => 1, 'avatar_size' => 120, 'link_text' => esc_attr__('View all posts', 'best-blog'), 'limit_chars' => '', )); $this->defaults = $defaults; } public function widget($args, $instance) { $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'CEO / Co-Founder' ,'best-blog'); extract($args); $instance = wp_parse_args((array) $instance, $this->defaults); ?>
' . get_the_author_meta('display_name'). ''; ?>

trim_chars($description, $instance['limit_chars'])); ?>

defaults); ?>

count_users() <= $this->users_split_at) : ?>



$limit) { $chars = array_slice($chars, 0, $limit); for ($i = ($limit -1); $i >= 0; $i--) { if (in_array($chars[$i], array( '.', ' ', '-', '?', '!' ))) { break; } } $chars = array_slice($chars, 0, $i); $string = implode('', $chars); $string = rtrim($string, ".,-?!"); $string.= $more; } } return $string; } } add_action('widgets_init', 'bestblog_author_widget_register'); function bestblog_author_widget_register() { register_widget('bestblog_Author_Widget'); }