$classes = $_GET['classes'];
                } else {
                    $classes = 'all';
                }
                $meta_key = '';
                if (is_multisite()) {
                    $meta_key = $wpdb->prefix . 'enrolled_course_class_' . $current_course_id;
                } else {
                    $meta_key = 'enrolled_course_class_' . $current_course_id;
                }
                $args = array('meta_query' => array('relation' => 'AND', array('key' => $meta_key, 'value' => '', 'compare' => 'EXISTS')));
                $additional_url_args = array();
                $additional_url_args['course_id'] = $current_course_id;
                $additional_url_args['classes'] = urlencode($classes);
                $additional_url_args['ungraded'] = isset($_GET['ungraded']) ? $_GET['ungraded'] : 'no';
                $student_search = new Student_Search('', $page_num, array(), $args, $additional_url_args);
                ?>
						<div id="tabs-<?php 
                echo $i;
                ?>
">
							<h2><?php 
                echo $current_unit->post_title;
                ?>
</h2>
							<?php 
                $columns = array("name" => __('Student', 'cp'), "module" => __('Element', 'cp'), "title" => __('Title', 'cp'), "submission_date" => __('Submitted', 'cp'), "response" => __('Response', 'cp'), "grade" => __('Grade', 'cp'), "comment" => __('Comment', 'cp'));
                $col_sizes = array('12', '12', '36', '15', '10', '10', '5');
                ?>

							<table cellspacing="0" class="widefat shadow-table assessment-archive-table">
示例#2
0
$style = '';
//search for students
if (isset($_GET['classes'])) {
    $classes = $_GET['classes'];
} else {
    $classes = 'all';
}
if ($classes !== 'all') {
    $args = array('meta_query' => array(array('key' => $class_meta_query_key, 'value' => $classes)));
} else {
    $args = array('meta_query' => array(array('key' => $class_meta_query_key)));
}
$additional_url_args = array();
$additional_url_args['course_id'] = $current_course_id;
$additional_url_args['classes'] = urlencode($classes);
$student_search = new Student_Search('', $page_num, array(), $args, $additional_url_args);
foreach ($student_search->get_results() as $user) {
    $user_object = new Student($user->ID);
    $roles = $user_object->roles;
    $role = array_shift($roles);
    $style = ' alternate' == $style ? '' : ' alternate';
    ?>
				<tr id='user-<?php 
    echo $user_object->ID;
    ?>
' class="<?php 
    echo $style;
    ?>
">
					<th scope='row' class='check-column'>
						<input type='checkbox' name='users[]' id='user_<?php 
    }
    $student = new Student($_GET['student_id']);
    $student->delete_student();
    $message = __('Selected student has been withdrawn from all courses successfully. Note: The user account still exists.', 'cp');
}
if (isset($_GET['action']) && ($_GET['action'] == 'edit' || $_GET['action'] == 'view') && isset($_GET['student_id']) && is_numeric($_GET['student_id'])) {
    include 'student-profile.php';
} else {
    if (isset($_GET['action']) && $_GET['action'] == 'workbook') {
        include 'student-workbook.php';
    } else {
        if (isset($_GET['action']) && $_GET['action'] == 'add_new') {
            include 'student-add.php';
        } else {
            // Query the users
            $wp_user_search = new Student_Search($usersearch, $page_num);
            ?>
	<div class="wrap nosubsub students cp-wrap">
		<div class="icon32" id="icon-users"><br></div>
		<h2><?php 
            _e('Students', 'cp');
            if (current_user_can('manage_options')) {
                ?>
				<a class="add-new-h2" href="user-new.php"><?php 
                _e('Add New', 'cp');
                ?>
</a><?php 
            }
            if (current_user_can('coursepress_add_new_students_cap') && !current_user_can('manage_options')) {
                ?>
				<a class="add-new-h2" href="<?php