-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
106 lines (76 loc) · 3.23 KB
/
Copy pathsingle.php
File metadata and controls
106 lines (76 loc) · 3.23 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/**
* The Template for displaying all single posts
*/
global $post;
$current_user_is_admin = woffice_current_is_admin();
$edit_allowed = (Woffice_Frontend::edit_allowed('post') == true) ? true : false;
$delete_allowed = (Woffice_Frontend::edit_allowed('post', 'delete') == true) ? true : false;
if ($edit_allowed) {
$process_result = Woffice_Frontend::frontend_process('post', $post->ID);
}
get_header(); ?>
<?php // Start the Loop.
while ( have_posts() ) : the_post(); ?>
<div id="left-content">
<?php //GET THEME HEADER CONTENT
woffice_title(get_the_title()); ?>
<!-- START THE CONTENT CONTAINER -->
<div id="content-container">
<!-- START CONTENT -->
<div id="content">
<?php //Woffice_Frontend::frontend_render('post',$hasError); ?>
<?php // We check for the role :
if (woffice_is_user_allowed()) { ?>
<?php // Include the page content template.
get_template_part( 'content');
?>
<?php
/*
* FRONT END EDIT
*/
if ($edit_allowed || $delete_allowed) { ?>
<div class="frontend-wrapper box">
<div class="intern-padding frontend-wrapper">
<div class="text-center" id="blog-bottom">
<?php if($edit_allowed) : ?>
<a href="#" class="btn btn-default frontend-wrapper__toggle" data-action="display"><i class="fa fa-pencil-alt"></i> <?php _e("Edit Post", "woffice"); ?></a>
<?php endif; ?>
<?php
/**
* Delete Button
* From version 1.8.6 if an user is allowed to edit then is allowed also to delete
* if (is_user_logged_in() && (current_user_can('edit_others_posts') || $current_user->ID == $post->post_author) ) {
*/
if($delete_allowed) {
echo '<a onclick="return confirm(\'' . __('Are you sure you wish to delete article :', 'woffice') . ' ' . get_the_title() . ' ?\')" href="' . get_delete_post_link(get_the_ID(), '') . '" class="btn btn-secondary">
<i class="fa fa-trash"></i> ' . __("Delete", "woffice") . '
</a>';
}
//}
?>
</div>
<?php if($edit_allowed) : ?>
<?php //Woffice_Frontend::frontend_render('post', $process_result, get_the_ID()); ?>
<?php endif; ?>
<?php //Woffice_Frontend::frontend_render('post',$frontend_process); ?>
</div>
</div>
<?php } ?>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
?>
<?php } else {
get_template_part( 'content', 'private' );
} ?>
</div>
</div><!-- END #content-container -->
<?php woffice_scroll_top(); ?>
</div><!-- END #left-content -->
<?php // END THE LOOP
endwhile; ?>
<?php
get_footer();