'widget_player_list widget_sp_player_list', 'description' => __( 'SportsPress widget.', 'sportspress' ) ); parent::__construct('sp_player_list', __( 'Player List', 'sportspress' ), $widget_ops); } function widget( $args, $instance ) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $id = empty($instance['id']) ? null : $instance['id']; $statistics = $instance['statistics']; $orderby = empty($instance['orderby']) ? 'number' : $instance['orderby']; $order = empty($instance['order']) ? 'ASC' : $instance['order']; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo '
'sp_list', 'name' => $this->get_field_name('id'), 'id' => $this->get_field_id('id'), 'selected' => $id, 'values' => 'ID', 'class' => 'widefat', ); if ( ! sportspress_dropdown_pages( $args ) ): sportspress_post_adder( 'sp_list' ); endif; ?>
'sp_statistic',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
);
$the_statistics = get_posts( $args );
$field_name = $this->get_field_name('statistics') . '[]';
$field_id = $this->get_field_id('statistics');
?>
'sp_statistic', 'show_option_all' => __( 'Number', 'sportspress' ), 'option_all_value' => 'number', 'show_option_none' => __( 'Played', 'sportspress' ), 'option_none_value' => 'eventsplayed', 'name' => $this->get_field_name('orderby'), 'id' => $this->get_field_id('orderby'), 'selected' => $orderby, 'values' => 'slug', 'class' => 'widefat', ); if ( ! sportspress_dropdown_pages( $args ) ): sportspress_post_adder( 'sp_list' ); endif; ?>