-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage-courses.php
74 lines (63 loc) · 1.84 KB
/
manage-courses.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/*
Template Name: Manage Your Courses
*/
get_header();
function manage() {
echo 'manage_called';
}
?>
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while (have_posts()) : the_post(); ?>
<div class="submit-course-form">
<?php
the_content();
$course = pods('course');
$fields = array (
'post_title',
'art_discipline',
'science_discipline',
'level',
'course_code',
'course_size',
'course_website',
'institution',
'institution_city',
'institution_stateprovince',
'departmentscenters',
'country',
'syllabus'
);
if (current_user_can('administrator'))
$uiArray = array(
'fields' => array (
'edit' => $fields,
'add' => $fields,
'duplicate' => $fields,
'manage' => array ('post_title')
)
);
else
$uiArray = array(
'where' => array (
'manage' => "t.post_author = '" . get_current_user_id() . "'"
),
'fields' => array (
'edit' => $fields,
'add' => $fields,
'duplicate' => $fields,
'manage' => array ('post_title')
)
);
$course->ui = $uiArray;
pods_ui($course, false);
?>
</div>
<?php endwhile; wp_reset_query(); ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .wrap -->
<?php get_footer();