'widget_calendar widget_player_list widget_sp_player_list', 'description' => __( 'Display a list of players.', 'sportspress' ) ); parent::__construct('sp_player_list', __( 'SportsPress 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']; $number = empty($instance['number']) ? null : $instance['number']; $performance = $instance['performance']; $orderby = empty($instance['orderby']) ? 'default' : $instance['orderby']; $order = empty($instance['order']) ? 'ASC' : $instance['order']; $show_all_players_link = empty($instance['show_all_players_link']) ? false : $instance['show_all_players_link']; 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 ( ! sp_dropdown_pages( $args ) ): sp_post_adder( 'sp_list', __( 'Add New', 'sportspress' ) ); endif; ?>
'sp_performance',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
);
$the_performance = get_posts( $args );
$field_name = $this->get_field_name('performance') . '[]';
$field_id = $this->get_field_id('performance');
?>
array( 'default' => __( 'Default', 'sportspress' ), 'number' => __( 'Number', 'sportspress' ), 'name' => __( 'Name', 'sportspress' ), 'eventsplayed' => __( 'Played', 'sportspress' ) ), 'post_type' => 'sp_performance', 'name' => $this->get_field_name('orderby'), 'id' => $this->get_field_id('orderby'), 'selected' => $orderby, 'values' => 'slug', 'class' => 'sp-select-orderby widefat', ); if ( ! sp_dropdown_pages( $args ) ): sp_post_adder( 'sp_list', __( 'Add New', 'sportspress' ) ); endif; ?>
>