-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage-my-notes.php
More file actions
52 lines (39 loc) · 1.72 KB
/
page-my-notes.php
File metadata and controls
52 lines (39 loc) · 1.72 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
<?php
if (!is_user_logged_in()) {
wp_redirect( esc_url(site_url('/')));
exit;
}
get_header();
while (have_posts()) {
the_post();
pageBanner();
?>
<div class="container container--narrow page-section">
<div class="create-note">
<h2 class="headline headline--medium">Create New Note</h2>
<input class="new-note-title" type="text" placeholder="title">
<textarea class="new-note-body" placeholder="your note here"></textarea>
<span class="submit-note">Create Note</span>
<span class="note-limit-message">Note limit reached. Delete existing note to make room for a new one.</span>
</div>
<ul id="my-notes" class="min-list link-list">
<?php
$userNotes = new WP_Query(array(
'post_type' => 'note',
'post_per_page' => '-1',
'author' => get_current_user_id()
));
while( $userNotes->have_posts() ) { $userNotes->the_post(); ?>
<li data-id="<?php the_ID(); ?>">
<input readonly class="note-title-field" value="<?php echo str_replace('Private: ', '', esc_attr(get_the_title())); ?>">
<span class="edit-note"><i class="fa fa-pencil" aria-hidden="true"></i> Edit Note</span>
<span class="delete-note"><i class="fa fa-trash-o" aria-hidden="true"></i> Delete Note</span>
<textarea readonly class="note-body-field"><?php echo esc_textarea(wp_strip_all_tags(get_the_content())); ?></textarea>
<span class="update-note btn btn--blue btn--small"><i class="fa fa-arrow-right" aria-hidden="true"></i> Update Note</span>
</li>
<?php } ?>
</ul>
</div>
<?php
}
get_footer() ?>