Version Description
- The admin screen UI has been updated.
- Enables to search Inbound Messages by keywords used in the Consent and Meta sections.
- Introduces personal data eraser for Address Book and Inbound Messages data.
Download this release
Release Info
Developer | takayukister |
Plugin | Flamingo |
Version | 1.9 |
Comparing to | |
See all releases |
Code changes from version 1.8 to 1.9
- admin/admin.php +56 -12
- admin/edit-contact-form.php +28 -24
- admin/edit-inbound-form.php +40 -36
- admin/edit-outbound-form.php +46 -44
- admin/includes/class-contacts-list-table.php +35 -13
- admin/includes/class-inbound-messages-list-table.php +49 -17
- admin/includes/class-outbound-messages-list-table.php +17 -7
- admin/includes/meta-boxes.php +65 -24
- admin/includes/privacy.php +101 -0
- flamingo.php +2 -2
- includes/akismet.php +5 -1
- includes/class-inbound-message.php +10 -4
- readme.txt +13 -9
admin/admin.php
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
require_once FLAMINGO_PLUGIN_DIR . '/admin/admin-functions.php';
|
|
|
4 |
|
5 |
add_action( 'admin_menu', 'flamingo_admin_menu', 8 );
|
6 |
|
@@ -90,6 +91,8 @@ function flamingo_admin_updated_message() {
|
|
90 |
$message = __( 'Contact updated.', 'flamingo' );
|
91 |
} elseif ( 'contactdeleted' == $_REQUEST['message'] ) {
|
92 |
$message = __( 'Contact deleted.', 'flamingo' );
|
|
|
|
|
93 |
} elseif ( 'inboundtrashed' == $_REQUEST['message'] ) {
|
94 |
$message = __( 'Messages trashed.', 'flamingo' );
|
95 |
} elseif ( 'inbounduntrashed' == $_REQUEST['message'] ) {
|
@@ -114,7 +117,7 @@ function flamingo_admin_updated_message() {
|
|
114 |
function flamingo_load_contact_admin() {
|
115 |
$action = flamingo_current_action();
|
116 |
|
117 |
-
$redirect_to =
|
118 |
|
119 |
if ( 'save' == $action && ! empty( $_REQUEST['post'] ) ) {
|
120 |
$post = new Flamingo_Contact( $_REQUEST['post'] );
|
@@ -251,7 +254,7 @@ function flamingo_load_contact_admin() {
|
|
251 |
|
252 |
if ( ! empty( $_GET['sendmail'] )
|
253 |
&& ! empty( $_REQUEST['contact_tag_id'] ) ) {
|
254 |
-
$redirect_to =
|
255 |
|
256 |
$redirect_to = add_query_arg(
|
257 |
array(
|
@@ -299,7 +302,8 @@ function flamingo_load_contact_admin() {
|
|
299 |
|
300 |
add_screen_option( 'per_page', array(
|
301 |
'label' => __( 'Contacts', 'flamingo' ),
|
302 |
-
'default' => 20
|
|
|
303 |
}
|
304 |
}
|
305 |
|
@@ -358,7 +362,39 @@ function flamingo_contact_edit_page() {
|
|
358 |
function flamingo_load_inbound_admin() {
|
359 |
$action = flamingo_current_action();
|
360 |
|
361 |
-
$redirect_to =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
362 |
|
363 |
if ( 'trash' == $action && ! empty( $_REQUEST['post'] ) ) {
|
364 |
if ( ! is_array( $_REQUEST['post'] ) ) {
|
@@ -650,17 +686,25 @@ function flamingo_load_inbound_admin() {
|
|
650 |
wp_die( __( "You are not allowed to edit this item.", 'flamingo' ) );
|
651 |
}
|
652 |
|
653 |
-
|
|
|
|
|
654 |
'flamingo_inbound_submit_meta_box', null, 'side', 'core' );
|
655 |
|
656 |
-
|
657 |
-
'
|
|
|
|
|
658 |
|
659 |
-
|
660 |
-
'
|
|
|
|
|
661 |
|
662 |
-
|
663 |
-
'
|
|
|
|
|
664 |
|
665 |
} else {
|
666 |
if ( ! class_exists( 'Flamingo_Inbound_Messages_List_Table' ) )
|
@@ -736,7 +780,7 @@ function flamingo_inbound_edit_page() {
|
|
736 |
function flamingo_load_outbound_admin() {
|
737 |
$action = flamingo_current_action();
|
738 |
|
739 |
-
$redirect_to =
|
740 |
|
741 |
$post_id = ! empty( $_REQUEST['post'] ) ? $_REQUEST['post'] : '';
|
742 |
|
1 |
<?php
|
2 |
|
3 |
require_once FLAMINGO_PLUGIN_DIR . '/admin/admin-functions.php';
|
4 |
+
require_once FLAMINGO_PLUGIN_DIR . '/admin/includes/privacy.php';
|
5 |
|
6 |
add_action( 'admin_menu', 'flamingo_admin_menu', 8 );
|
7 |
|
91 |
$message = __( 'Contact updated.', 'flamingo' );
|
92 |
} elseif ( 'contactdeleted' == $_REQUEST['message'] ) {
|
93 |
$message = __( 'Contact deleted.', 'flamingo' );
|
94 |
+
} elseif ( 'inboundupdated' == $_REQUEST['message'] ) {
|
95 |
+
$message = __( 'Messages updated.', 'flamingo' );
|
96 |
} elseif ( 'inboundtrashed' == $_REQUEST['message'] ) {
|
97 |
$message = __( 'Messages trashed.', 'flamingo' );
|
98 |
} elseif ( 'inbounduntrashed' == $_REQUEST['message'] ) {
|
117 |
function flamingo_load_contact_admin() {
|
118 |
$action = flamingo_current_action();
|
119 |
|
120 |
+
$redirect_to = menu_page_url( 'flamingo', false );
|
121 |
|
122 |
if ( 'save' == $action && ! empty( $_REQUEST['post'] ) ) {
|
123 |
$post = new Flamingo_Contact( $_REQUEST['post'] );
|
254 |
|
255 |
if ( ! empty( $_GET['sendmail'] )
|
256 |
&& ! empty( $_REQUEST['contact_tag_id'] ) ) {
|
257 |
+
$redirect_to = menu_page_url( 'flamingo_outbound', false );
|
258 |
|
259 |
$redirect_to = add_query_arg(
|
260 |
array(
|
302 |
|
303 |
add_screen_option( 'per_page', array(
|
304 |
'label' => __( 'Contacts', 'flamingo' ),
|
305 |
+
'default' => 20,
|
306 |
+
) );
|
307 |
}
|
308 |
}
|
309 |
|
362 |
function flamingo_load_inbound_admin() {
|
363 |
$action = flamingo_current_action();
|
364 |
|
365 |
+
$redirect_to = menu_page_url( 'flamingo_inbound', false );
|
366 |
+
|
367 |
+
if ( 'save' == $action && ! empty( $_REQUEST['post'] ) ) {
|
368 |
+
$post = new Flamingo_Inbound_Message( $_REQUEST['post'] );
|
369 |
+
|
370 |
+
if ( ! empty( $post ) ) {
|
371 |
+
if ( ! current_user_can( 'flamingo_edit_inbound_message', $post->id ) ) {
|
372 |
+
wp_die( __( 'You are not allowed to edit this item.', 'flamingo' ) );
|
373 |
+
}
|
374 |
+
|
375 |
+
check_admin_referer( 'flamingo-update-inbound_' . $post->id );
|
376 |
+
|
377 |
+
$status = isset( $_POST['inbound']['status'] )
|
378 |
+
? $_POST['inbound']['status'] : '';
|
379 |
+
|
380 |
+
if ( ! $post->spam && 'spam' === $status ) {
|
381 |
+
$post->spam();
|
382 |
+
} elseif ( $post->spam && 'ham' === $status ) {
|
383 |
+
$post->unspam();
|
384 |
+
}
|
385 |
+
|
386 |
+
$redirect_to = add_query_arg(
|
387 |
+
array(
|
388 |
+
'action' => 'edit',
|
389 |
+
'post' => $post->id,
|
390 |
+
'message' => 'inboundupdated',
|
391 |
+
), $redirect_to
|
392 |
+
);
|
393 |
+
}
|
394 |
+
|
395 |
+
wp_safe_redirect( $redirect_to );
|
396 |
+
exit();
|
397 |
+
}
|
398 |
|
399 |
if ( 'trash' == $action && ! empty( $_REQUEST['post'] ) ) {
|
400 |
if ( ! is_array( $_REQUEST['post'] ) ) {
|
686 |
wp_die( __( "You are not allowed to edit this item.", 'flamingo' ) );
|
687 |
}
|
688 |
|
689 |
+
$post = new Flamingo_Inbound_Message( $post_id );
|
690 |
+
|
691 |
+
add_meta_box( 'submitdiv', __( 'Status', 'flamingo' ),
|
692 |
'flamingo_inbound_submit_meta_box', null, 'side', 'core' );
|
693 |
|
694 |
+
if ( ! empty( $post->fields ) ) {
|
695 |
+
add_meta_box( 'inboundfieldsdiv', __( 'Fields', 'flamingo' ),
|
696 |
+
'flamingo_inbound_fields_meta_box', null, 'normal', 'core' );
|
697 |
+
}
|
698 |
|
699 |
+
if ( ! empty( $post->consent ) ) {
|
700 |
+
add_meta_box( 'inboundconsentdiv', __( 'Consent', 'flamingo' ),
|
701 |
+
'flamingo_inbound_consent_meta_box', null, 'normal', 'core' );
|
702 |
+
}
|
703 |
|
704 |
+
if ( ! empty( $post->meta ) ) {
|
705 |
+
add_meta_box( 'inboundmetadiv', __( 'Meta', 'flamingo' ),
|
706 |
+
'flamingo_inbound_meta_meta_box', null, 'normal', 'core' );
|
707 |
+
}
|
708 |
|
709 |
} else {
|
710 |
if ( ! class_exists( 'Flamingo_Inbound_Messages_List_Table' ) )
|
780 |
function flamingo_load_outbound_admin() {
|
781 |
$action = flamingo_current_action();
|
782 |
|
783 |
+
$redirect_to = menu_page_url( 'flamingo_outbound', false );
|
784 |
|
785 |
$post_id = ! empty( $_REQUEST['post'] ) ? $_REQUEST['post'] : '';
|
786 |
|
admin/edit-contact-form.php
CHANGED
@@ -12,46 +12,52 @@ if ( ! empty( $post->id ) ) {
|
|
12 |
}
|
13 |
|
14 |
?>
|
15 |
-
<div class="wrap
|
16 |
|
17 |
<h1><?php echo esc_html( __( 'Edit Contact', 'flamingo' ) ); ?></h1>
|
18 |
|
19 |
<?php do_action( 'flamingo_admin_updated_message', $post ); ?>
|
20 |
|
21 |
-
<form name="editcontact" id="editcontact" method="post" action="">
|
22 |
<?php
|
23 |
wp_nonce_field( $nonce_action );
|
24 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
25 |
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
26 |
?>
|
27 |
|
28 |
-
<div id="poststuff"
|
29 |
-
<div id="
|
30 |
-
<?php
|
31 |
-
do_meta_boxes( null, 'side', $post );
|
32 |
-
?>
|
33 |
-
</div><!-- #side-info-column -->
|
34 |
|
35 |
-
<div id="post-body">
|
36 |
<div id="post-body-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
<div id="
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
<label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php echo esc_html( __( 'Enter email here', 'flamingo' ) ); ?></label>
|
44 |
-
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( $post->email ); ?>" id="title" autocomplete="off" />
|
45 |
-
<?php endif; ?>
|
46 |
-
</div>
|
47 |
-
</div>
|
48 |
|
|
|
49 |
<?php
|
50 |
-
do_meta_boxes( null, 'normal', $post );
|
51 |
-
do_meta_boxes( null, 'advanced', $post );
|
52 |
?>
|
53 |
-
</div><!-- #
|
|
|
54 |
</div><!-- #post-body -->
|
|
|
|
|
|
|
55 |
|
56 |
<?php if ( $post->id ) : ?>
|
57 |
<input type="hidden" name="action" value="save" />
|
@@ -59,8 +65,6 @@ do_meta_boxes( null, 'advanced', $post );
|
|
59 |
<?php else: ?>
|
60 |
<input type="hidden" name="action" value="add" />
|
61 |
<?php endif; ?>
|
62 |
-
|
63 |
-
</div><!-- #poststuff -->
|
64 |
</form>
|
65 |
|
66 |
</div><!-- .wrap -->
|
12 |
}
|
13 |
|
14 |
?>
|
15 |
+
<div class="wrap">
|
16 |
|
17 |
<h1><?php echo esc_html( __( 'Edit Contact', 'flamingo' ) ); ?></h1>
|
18 |
|
19 |
<?php do_action( 'flamingo_admin_updated_message', $post ); ?>
|
20 |
|
21 |
+
<form name="editcontact" id="editcontact" method="post" action="<?php echo esc_url( add_query_arg( array( 'post' => $post->id ), menu_page_url( 'flamingo', false ) ) ); ?>">
|
22 |
<?php
|
23 |
wp_nonce_field( $nonce_action );
|
24 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
25 |
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
26 |
?>
|
27 |
|
28 |
+
<div id="poststuff">
|
29 |
+
<div id="post-body" class="metabox-holder columns-2">
|
|
|
|
|
|
|
|
|
30 |
|
|
|
31 |
<div id="post-body-content">
|
32 |
+
<div id="titlediv">
|
33 |
+
<div id="titlewrap">
|
34 |
+
<?php if ( ! empty( $post->id ) ) : ?>
|
35 |
+
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( $post->email ); ?>" id="title" disabled="disabled" />
|
36 |
+
<?php else : ?>
|
37 |
+
<label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php echo esc_html( __( 'Enter email here', 'flamingo' ) ); ?></label>
|
38 |
+
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( $post->email ); ?>" id="title" autocomplete="off" />
|
39 |
+
<?php endif; ?>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div><!-- #post-body-content -->
|
43 |
|
44 |
+
<div id="postbox-container-1" class="postbox-container">
|
45 |
+
<?php
|
46 |
+
do_meta_boxes( null, 'side', $post );
|
47 |
+
?>
|
48 |
+
</div><!-- #postbox-container-1 -->
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
+
<div id="postbox-container-2" class="postbox-container">
|
51 |
<?php
|
52 |
+
do_meta_boxes( null, 'normal', $post );
|
53 |
+
do_meta_boxes( null, 'advanced', $post );
|
54 |
?>
|
55 |
+
</div><!-- #postbox-container-2 -->
|
56 |
+
|
57 |
</div><!-- #post-body -->
|
58 |
+
<br class="clear" />
|
59 |
+
|
60 |
+
</div><!-- #poststuff -->
|
61 |
|
62 |
<?php if ( $post->id ) : ?>
|
63 |
<input type="hidden" name="action" value="save" />
|
65 |
<?php else: ?>
|
66 |
<input type="hidden" name="action" value="add" />
|
67 |
<?php endif; ?>
|
|
|
|
|
68 |
</form>
|
69 |
|
70 |
</div><!-- .wrap -->
|
admin/edit-inbound-form.php
CHANGED
@@ -12,58 +12,64 @@ if ( ! empty( $post->id ) ) {
|
|
12 |
}
|
13 |
|
14 |
?>
|
15 |
-
<div class="wrap
|
16 |
|
17 |
<h1><?php echo esc_html( __( 'Inbound Message', 'flamingo' ) ); ?></h1>
|
18 |
|
19 |
<?php do_action( 'flamingo_admin_updated_message', $post ); ?>
|
20 |
|
21 |
-
<form name="editinbound" id="editinbound" method="post" action="">
|
22 |
<?php
|
23 |
wp_nonce_field( $nonce_action );
|
24 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
25 |
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
26 |
?>
|
27 |
|
28 |
-
<div id="poststuff"
|
29 |
-
<div id="
|
30 |
-
<?php
|
31 |
-
do_meta_boxes( null, 'side', $post );
|
32 |
-
?>
|
33 |
-
</div><!-- #side-info-column -->
|
34 |
|
35 |
-
<div id="post-body">
|
36 |
<div id="post-body-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
<
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
<td><?php echo esc_html( $post->date ); ?></td>
|
44 |
-
</tr>
|
45 |
-
|
46 |
-
<tr class="message-subject">
|
47 |
-
<th><?php echo esc_html( __( 'Subject', 'flamingo' ) ); ?>:</th>
|
48 |
-
<td><?php echo esc_html( $post->subject ); ?></td>
|
49 |
-
</tr>
|
50 |
-
|
51 |
-
<tr class="message-from">
|
52 |
-
<th><?php echo esc_html( __( 'From', 'flamingo' ) ); ?>:</th>
|
53 |
-
<td><?php if ( ! empty( $post->from_email ) ) { ?><a href="<?php echo admin_url( 'admin.php?page=flamingo&s=' . urlencode( $post->from_email ) ); ?>" title="<?php echo esc_attr( $post->from ); ?>"><?php echo esc_html( $post->from ); ?></a><?php } else { echo esc_html( $post->from ); } ?></td>
|
54 |
-
</tr>
|
55 |
-
|
56 |
-
</tbody>
|
57 |
-
</table>
|
58 |
-
|
59 |
-
<br class="clear" />
|
60 |
|
|
|
61 |
<?php
|
62 |
-
do_meta_boxes( null, 'normal', $post );
|
63 |
-
do_meta_boxes( null, 'advanced', $post );
|
64 |
?>
|
65 |
-
</div><!-- #
|
|
|
66 |
</div><!-- #post-body -->
|
|
|
|
|
|
|
67 |
|
68 |
<?php if ( $post->id ) : ?>
|
69 |
<input type="hidden" name="action" value="save" />
|
@@ -71,8 +77,6 @@ do_meta_boxes( null, 'advanced', $post );
|
|
71 |
<?php else: ?>
|
72 |
<input type="hidden" name="action" value="add" />
|
73 |
<?php endif; ?>
|
74 |
-
|
75 |
-
</div><!-- #poststuff -->
|
76 |
</form>
|
77 |
|
78 |
</div><!-- .wrap -->
|
12 |
}
|
13 |
|
14 |
?>
|
15 |
+
<div class="wrap">
|
16 |
|
17 |
<h1><?php echo esc_html( __( 'Inbound Message', 'flamingo' ) ); ?></h1>
|
18 |
|
19 |
<?php do_action( 'flamingo_admin_updated_message', $post ); ?>
|
20 |
|
21 |
+
<form name="editinbound" id="editinbound" method="post" action="<?php echo esc_url( add_query_arg( array( 'post' => $post->id ), menu_page_url( 'flamingo_inbound', false ) ) ); ?>">
|
22 |
<?php
|
23 |
wp_nonce_field( $nonce_action );
|
24 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
25 |
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
26 |
?>
|
27 |
|
28 |
+
<div id="poststuff">
|
29 |
+
<div id="post-body" class="metabox-holder columns-2">
|
|
|
|
|
|
|
|
|
30 |
|
|
|
31 |
<div id="post-body-content">
|
32 |
+
<table class="message-main-fields">
|
33 |
+
<tbody>
|
34 |
+
|
35 |
+
<tr class="message-subject">
|
36 |
+
<th><?php echo esc_html( __( 'Subject', 'flamingo' ) ); ?>:</th>
|
37 |
+
<td><?php echo esc_html( $post->subject ); ?></td>
|
38 |
+
</tr>
|
39 |
+
|
40 |
+
<tr class="message-from">
|
41 |
+
<th><?php echo esc_html( __( 'From', 'flamingo' ) ); ?>:</th>
|
42 |
+
<td><?php if ( ! empty( $post->from_email ) ) { ?><a href="<?php
|
43 |
+
echo esc_url( add_query_arg(
|
44 |
+
array(
|
45 |
+
's' => $post->from_email,
|
46 |
+
),
|
47 |
+
menu_page_url( 'flamingo', false )
|
48 |
+
) );
|
49 |
+
?>" aria-label="<?php echo esc_attr( $post->from ); ?>"><?php echo esc_html( $post->from ); ?></a><?php } else { echo esc_html( $post->from ); } ?></td>
|
50 |
+
</tr>
|
51 |
+
|
52 |
+
</tbody>
|
53 |
+
</table>
|
54 |
+
</div><!-- #post-body-content -->
|
55 |
|
56 |
+
<div id="postbox-container-1" class="postbox-container">
|
57 |
+
<?php
|
58 |
+
do_meta_boxes( null, 'side', $post );
|
59 |
+
?>
|
60 |
+
</div><!-- #postbox-container-1 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
+
<div id="postbox-container-2" class="postbox-container">
|
63 |
<?php
|
64 |
+
do_meta_boxes( null, 'normal', $post );
|
65 |
+
do_meta_boxes( null, 'advanced', $post );
|
66 |
?>
|
67 |
+
</div><!-- #postbox-container-2 -->
|
68 |
+
|
69 |
</div><!-- #post-body -->
|
70 |
+
<br class="clear" />
|
71 |
+
|
72 |
+
</div><!-- #poststuff -->
|
73 |
|
74 |
<?php if ( $post->id ) : ?>
|
75 |
<input type="hidden" name="action" value="save" />
|
77 |
<?php else: ?>
|
78 |
<input type="hidden" name="action" value="add" />
|
79 |
<?php endif; ?>
|
|
|
|
|
80 |
</form>
|
81 |
|
82 |
</div><!-- .wrap -->
|
admin/edit-outbound-form.php
CHANGED
@@ -12,7 +12,7 @@ if ( ! empty( $post->id ) ) {
|
|
12 |
}
|
13 |
|
14 |
?>
|
15 |
-
<div class="wrap
|
16 |
|
17 |
<h1><?php
|
18 |
if ( 'new' == $action ) {
|
@@ -24,67 +24,69 @@ if ( ! empty( $post->id ) ) {
|
|
24 |
|
25 |
<?php do_action( 'flamingo_admin_updated_message', $post ); ?>
|
26 |
|
27 |
-
<form name="editoutbound" id="editoutbound" method="post" action="">
|
28 |
<?php
|
29 |
wp_nonce_field( $nonce_action );
|
30 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
31 |
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
32 |
?>
|
33 |
|
34 |
-
<div id="poststuff"
|
35 |
-
<div id="
|
36 |
-
<?php
|
37 |
-
do_meta_boxes( null, 'side', $post );
|
38 |
-
?>
|
39 |
-
</div><!-- #side-info-column -->
|
40 |
|
41 |
-
<div id="post-body">
|
42 |
<div id="post-body-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
<
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
<td><?php if ( $contact_tag ) : ?>
|
50 |
-
<?php echo esc_html( $contact_tag->name ); ?>
|
51 |
-
<input type="hidden" name="contact-tag-id" value="<?php echo absint( $contact_tag->term_id ); ?>" />
|
52 |
-
<?php endif; ?></td>
|
53 |
-
</tr>
|
54 |
-
|
55 |
-
<tr class="message-from">
|
56 |
-
<th><?php echo esc_html( __( 'From', 'flamingo' ) ); ?>:</th>
|
57 |
-
<td><input type="text" name="from" class="large-text" value="" /></td>
|
58 |
-
</tr>
|
59 |
-
|
60 |
-
<tr class="message-subject">
|
61 |
-
<th><?php echo esc_html( __( 'Subject', 'flamingo' ) ); ?>:</th>
|
62 |
-
<td><input type="text" name="subject" class="large-text" value="" /></td>
|
63 |
-
</tr>
|
64 |
-
|
65 |
-
<tr class="message-body">
|
66 |
-
<th><?php echo esc_html( __( 'Body', 'flamingo' ) ); ?>:</th>
|
67 |
-
<td><textarea name="body" class="large-text" cols="50" rows="10"></textarea></td>
|
68 |
-
</tr>
|
69 |
-
|
70 |
-
</tbody>
|
71 |
-
</table>
|
72 |
-
|
73 |
-
<br class="clear" />
|
74 |
|
|
|
75 |
<?php
|
76 |
-
do_meta_boxes( null, 'normal', $post );
|
77 |
-
do_meta_boxes( null, 'advanced', $post );
|
78 |
?>
|
79 |
-
</div><!-- #
|
|
|
80 |
</div><!-- #post-body -->
|
|
|
|
|
|
|
81 |
|
82 |
<input type="hidden" name="action" value="save" />
|
83 |
<?php if ( ! empty( $post->id ) ) : ?>
|
84 |
<input type="hidden" name="post" value="<?php echo (int) $post->id; ?>" />
|
85 |
<?php endif; ?>
|
86 |
-
|
87 |
-
</div><!-- #poststuff -->
|
88 |
</form>
|
89 |
|
90 |
</div><!-- .wrap -->
|
12 |
}
|
13 |
|
14 |
?>
|
15 |
+
<div class="wrap">
|
16 |
|
17 |
<h1><?php
|
18 |
if ( 'new' == $action ) {
|
24 |
|
25 |
<?php do_action( 'flamingo_admin_updated_message', $post ); ?>
|
26 |
|
27 |
+
<form name="editoutbound" id="editoutbound" method="post" action="<?php echo esc_url( add_query_arg( array( 'post' => $post->id ), menu_page_url( 'flamingo_outbound', false ) ) ); ?>">
|
28 |
<?php
|
29 |
wp_nonce_field( $nonce_action );
|
30 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
31 |
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
32 |
?>
|
33 |
|
34 |
+
<div id="poststuff">
|
35 |
+
<div id="post-body" class="metabox-holder columns-2">
|
|
|
|
|
|
|
|
|
36 |
|
|
|
37 |
<div id="post-body-content">
|
38 |
+
<table class="message-main-fields">
|
39 |
+
<tbody>
|
40 |
+
|
41 |
+
<tr class="message-to">
|
42 |
+
<th><?php echo esc_html( __( 'To', 'flamingo' ) ); ?>:</th>
|
43 |
+
<td><?php if ( $contact_tag ) : ?>
|
44 |
+
<?php echo esc_html( $contact_tag->name ); ?>
|
45 |
+
<input type="hidden" name="contact-tag-id" value="<?php echo absint( $contact_tag->term_id ); ?>" />
|
46 |
+
<?php endif; ?></td>
|
47 |
+
</tr>
|
48 |
+
|
49 |
+
<tr class="message-from">
|
50 |
+
<th><?php echo esc_html( __( 'From', 'flamingo' ) ); ?>:</th>
|
51 |
+
<td><input type="text" name="from" class="large-text" value="" /></td>
|
52 |
+
</tr>
|
53 |
+
|
54 |
+
<tr class="message-subject">
|
55 |
+
<th><?php echo esc_html( __( 'Subject', 'flamingo' ) ); ?>:</th>
|
56 |
+
<td><input type="text" name="subject" class="large-text" value="" /></td>
|
57 |
+
</tr>
|
58 |
+
|
59 |
+
<tr class="message-body">
|
60 |
+
<th><?php echo esc_html( __( 'Body', 'flamingo' ) ); ?>:</th>
|
61 |
+
<td><textarea name="body" class="large-text" cols="50" rows="10"></textarea></td>
|
62 |
+
</tr>
|
63 |
+
|
64 |
+
</tbody>
|
65 |
+
</table>
|
66 |
+
</div><!-- #post-body-content -->
|
67 |
|
68 |
+
<div id="postbox-container-1" class="postbox-container">
|
69 |
+
<?php
|
70 |
+
do_meta_boxes( null, 'side', $post );
|
71 |
+
?>
|
72 |
+
</div><!-- #postbox-container-1 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
+
<div id="postbox-container-2" class="postbox-container">
|
75 |
<?php
|
76 |
+
do_meta_boxes( null, 'normal', $post );
|
77 |
+
do_meta_boxes( null, 'advanced', $post );
|
78 |
?>
|
79 |
+
</div><!-- #postbox-container-2 -->
|
80 |
+
|
81 |
</div><!-- #post-body -->
|
82 |
+
<br class="clear" />
|
83 |
+
|
84 |
+
</div><!-- #poststuff -->
|
85 |
|
86 |
<input type="hidden" name="action" value="save" />
|
87 |
<?php if ( ! empty( $post->id ) ) : ?>
|
88 |
<input type="hidden" name="post" value="<?php echo (int) $post->id; ?>" />
|
89 |
<?php endif; ?>
|
|
|
|
|
90 |
</form>
|
91 |
|
92 |
</div><!-- .wrap -->
|
admin/includes/class-contacts-list-table.php
CHANGED
@@ -151,8 +151,14 @@ class Flamingo_Contacts_List_Table extends WP_List_Table {
|
|
151 |
function column_email( $item ) {
|
152 |
$actions = array();
|
153 |
$post_id = absint( $item->id );
|
154 |
-
|
155 |
-
$edit_link = add_query_arg(
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
if ( current_user_can( 'flamingo_edit_contact', $post_id ) ) {
|
158 |
$actions['edit'] = sprintf( '<a href="%1$s">%2$s</a>',
|
@@ -160,7 +166,7 @@ class Flamingo_Contacts_List_Table extends WP_List_Table {
|
|
160 |
}
|
161 |
|
162 |
if ( current_user_can( 'flamingo_edit_contact', $post_id ) ) {
|
163 |
-
return sprintf( '<strong><a class="row-title" href="%1$s"
|
164 |
esc_url( $edit_link ),
|
165 |
esc_attr( sprintf( __( 'Edit “%s”', 'flamingo' ), $item->email ) ),
|
166 |
esc_html( $item->email ),
|
@@ -194,11 +200,18 @@ class Flamingo_Contacts_List_Table extends WP_List_Table {
|
|
194 |
$output .= ', ';
|
195 |
}
|
196 |
|
197 |
-
$link =
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
|
204 |
return $output;
|
@@ -244,10 +257,19 @@ class Flamingo_Contacts_List_Table extends WP_List_Table {
|
|
244 |
continue;
|
245 |
}
|
246 |
|
247 |
-
$link =
|
248 |
-
|
249 |
-
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
. '</a>';
|
252 |
}
|
253 |
}
|
@@ -280,6 +302,6 @@ class Flamingo_Contacts_List_Table extends WP_List_Table {
|
|
280 |
$h_time = mysql2date( __( 'Y/m/d', 'flamingo' ), $m_time );
|
281 |
}
|
282 |
|
283 |
-
return '<abbr
|
284 |
}
|
285 |
}
|
151 |
function column_email( $item ) {
|
152 |
$actions = array();
|
153 |
$post_id = absint( $item->id );
|
154 |
+
|
155 |
+
$edit_link = add_query_arg(
|
156 |
+
array(
|
157 |
+
'post' => $post_id,
|
158 |
+
'action' => 'edit',
|
159 |
+
),
|
160 |
+
menu_page_url( 'flamingo', false )
|
161 |
+
);
|
162 |
|
163 |
if ( current_user_can( 'flamingo_edit_contact', $post_id ) ) {
|
164 |
$actions['edit'] = sprintf( '<a href="%1$s">%2$s</a>',
|
166 |
}
|
167 |
|
168 |
if ( current_user_can( 'flamingo_edit_contact', $post_id ) ) {
|
169 |
+
return sprintf( '<strong><a class="row-title" href="%1$s" aria-label="%2$s">%3$s</a></strong> %4$s',
|
170 |
esc_url( $edit_link ),
|
171 |
esc_attr( sprintf( __( 'Edit “%s”', 'flamingo' ), $item->email ) ),
|
172 |
esc_html( $item->email ),
|
200 |
$output .= ', ';
|
201 |
}
|
202 |
|
203 |
+
$link = add_query_arg(
|
204 |
+
array(
|
205 |
+
'contact_tag_id' => $term->term_id,
|
206 |
+
),
|
207 |
+
menu_page_url( 'flamingo', false )
|
208 |
+
);
|
209 |
+
|
210 |
+
$output .= sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>',
|
211 |
+
esc_url( $link ),
|
212 |
+
esc_attr( $term->name ),
|
213 |
+
esc_html( $term->name )
|
214 |
+
);
|
215 |
}
|
216 |
|
217 |
return $output;
|
257 |
continue;
|
258 |
}
|
259 |
|
260 |
+
$link = add_query_arg(
|
261 |
+
array(
|
262 |
+
'channel' => $term->slug,
|
263 |
+
's' => $item->email,
|
264 |
+
),
|
265 |
+
menu_page_url( 'flamingo_inbound', false )
|
266 |
+
);
|
267 |
+
|
268 |
+
$history[] = '<a href="' . esc_url( $link ) . '">'
|
269 |
+
/* translators: 1: contact channel name, 2: contact count */
|
270 |
+
. sprintf( _x( '%1$s (%2$d)', 'contact history', 'flamingo' ),
|
271 |
+
$term->name,
|
272 |
+
$count )
|
273 |
. '</a>';
|
274 |
}
|
275 |
}
|
302 |
$h_time = mysql2date( __( 'Y/m/d', 'flamingo' ), $m_time );
|
303 |
}
|
304 |
|
305 |
+
return '<abbr aria-label="' . $t_time . '">' . $h_time . '</abbr>';
|
306 |
}
|
307 |
}
|
admin/includes/class-inbound-messages-list-table.php
CHANGED
@@ -114,7 +114,7 @@ class Flamingo_Inbound_Messages_List_Table extends WP_List_Table {
|
|
114 |
number_format_i18n( $posts_in_inbox ) );
|
115 |
|
116 |
$status_links['inbox'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
117 |
-
|
118 |
( $this->is_trash || $this->is_spam ) ? '' : ' class="current"',
|
119 |
$inbox );
|
120 |
|
@@ -130,9 +130,15 @@ class Flamingo_Inbound_Messages_List_Table extends WP_List_Table {
|
|
130 |
number_format_i18n( $posts_in_spam ) );
|
131 |
|
132 |
$status_links['spam'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
134 |
'spam' == $post_status ? ' class="current"' : '',
|
135 |
-
$spam
|
|
|
136 |
|
137 |
// Trash
|
138 |
Flamingo_Inbound_Message::find( array( 'post_status' => 'trash' ) );
|
@@ -149,7 +155,12 @@ class Flamingo_Inbound_Messages_List_Table extends WP_List_Table {
|
|
149 |
number_format_i18n( $posts_in_trash ) );
|
150 |
|
151 |
$status_links['trash'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
153 |
'trash' == $post_status ? ' class="current"' : '',
|
154 |
$trash );
|
155 |
|
@@ -266,12 +277,19 @@ class Flamingo_Inbound_Messages_List_Table extends WP_List_Table {
|
|
266 |
|
267 |
$actions = array();
|
268 |
$post_id = absint( $item->id );
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
$edit_link = add_query_arg( array( 'action' => 'edit' ), $base_url );
|
271 |
|
272 |
if ( current_user_can( 'flamingo_edit_inbound_message', $post_id ) ) {
|
273 |
$actions['edit'] = sprintf( '<a href="%1$s">%2$s</a>',
|
274 |
-
esc_url( $edit_link ), esc_html( __( '
|
275 |
}
|
276 |
|
277 |
if ( $item->spam
|
@@ -295,7 +313,7 @@ class Flamingo_Inbound_Messages_List_Table extends WP_List_Table {
|
|
295 |
}
|
296 |
|
297 |
if ( current_user_can( 'flamingo_edit_inbound_message', $post_id ) ) {
|
298 |
-
return sprintf( '<strong><a class="row-title" href="%1$s"
|
299 |
esc_url( $edit_link ),
|
300 |
esc_attr( sprintf( __( 'Edit “%s”', 'flamingo' ), $item->subject ) ),
|
301 |
esc_html( $item->subject ),
|
@@ -335,18 +353,32 @@ class Flamingo_Inbound_Messages_List_Table extends WP_List_Table {
|
|
335 |
continue;
|
336 |
}
|
337 |
|
338 |
-
$link =
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
}
|
344 |
|
345 |
-
$link =
|
346 |
-
|
|
|
|
|
|
|
|
|
347 |
|
348 |
-
$output .= sprintf( '<a href="%1$s"
|
349 |
-
|
|
|
|
|
|
|
350 |
|
351 |
return $output;
|
352 |
}
|
@@ -370,6 +402,6 @@ class Flamingo_Inbound_Messages_List_Table extends WP_List_Table {
|
|
370 |
$h_time = mysql2date( __( 'Y/m/d', 'flamingo' ), $m_time );
|
371 |
}
|
372 |
|
373 |
-
return '<abbr
|
374 |
}
|
375 |
}
|
114 |
number_format_i18n( $posts_in_inbox ) );
|
115 |
|
116 |
$status_links['inbox'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
117 |
+
menu_page_url( 'flamingo_inbound', false ),
|
118 |
( $this->is_trash || $this->is_spam ) ? '' : ' class="current"',
|
119 |
$inbox );
|
120 |
|
130 |
number_format_i18n( $posts_in_spam ) );
|
131 |
|
132 |
$status_links['spam'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
133 |
+
esc_url( add_query_arg(
|
134 |
+
array(
|
135 |
+
'post_status' => 'spam',
|
136 |
+
),
|
137 |
+
menu_page_url( 'flamingo_inbound', false )
|
138 |
+
) ),
|
139 |
'spam' == $post_status ? ' class="current"' : '',
|
140 |
+
$spam
|
141 |
+
);
|
142 |
|
143 |
// Trash
|
144 |
Flamingo_Inbound_Message::find( array( 'post_status' => 'trash' ) );
|
155 |
number_format_i18n( $posts_in_trash ) );
|
156 |
|
157 |
$status_links['trash'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
158 |
+
esc_url( add_query_arg(
|
159 |
+
array(
|
160 |
+
'post_status' => 'trash',
|
161 |
+
),
|
162 |
+
menu_page_url( 'flamingo_inbound', false )
|
163 |
+
) ),
|
164 |
'trash' == $post_status ? ' class="current"' : '',
|
165 |
$trash );
|
166 |
|
277 |
|
278 |
$actions = array();
|
279 |
$post_id = absint( $item->id );
|
280 |
+
|
281 |
+
$base_url = add_query_arg(
|
282 |
+
array(
|
283 |
+
'post' => $post_id,
|
284 |
+
),
|
285 |
+
menu_page_url( 'flamingo_inbound', false )
|
286 |
+
);
|
287 |
+
|
288 |
$edit_link = add_query_arg( array( 'action' => 'edit' ), $base_url );
|
289 |
|
290 |
if ( current_user_can( 'flamingo_edit_inbound_message', $post_id ) ) {
|
291 |
$actions['edit'] = sprintf( '<a href="%1$s">%2$s</a>',
|
292 |
+
esc_url( $edit_link ), esc_html( __( 'View', 'flamingo' ) ) );
|
293 |
}
|
294 |
|
295 |
if ( $item->spam
|
313 |
}
|
314 |
|
315 |
if ( current_user_can( 'flamingo_edit_inbound_message', $post_id ) ) {
|
316 |
+
return sprintf( '<strong><a class="row-title" href="%1$s" aria-label="%2$s">%3$s</a></strong> %4$s',
|
317 |
esc_url( $edit_link ),
|
318 |
esc_attr( sprintf( __( 'Edit “%s”', 'flamingo' ), $item->subject ) ),
|
319 |
esc_html( $item->subject ),
|
353 |
continue;
|
354 |
}
|
355 |
|
356 |
+
$link = add_query_arg(
|
357 |
+
array(
|
358 |
+
'channel' => $parent->slug,
|
359 |
+
),
|
360 |
+
menu_page_url( 'flamingo_inbound', false )
|
361 |
+
);
|
362 |
+
|
363 |
+
$output .= sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a> / ',
|
364 |
+
esc_url( $link ),
|
365 |
+
esc_attr( $parent->name ),
|
366 |
+
esc_html( $parent->name )
|
367 |
+
);
|
368 |
}
|
369 |
|
370 |
+
$link = add_query_arg(
|
371 |
+
array(
|
372 |
+
'channel' => $term->slug,
|
373 |
+
),
|
374 |
+
menu_page_url( 'flamingo_inbound', false )
|
375 |
+
);
|
376 |
|
377 |
+
$output .= sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>',
|
378 |
+
esc_url( $link ),
|
379 |
+
esc_attr( $term->name ),
|
380 |
+
esc_html( $term->name )
|
381 |
+
);
|
382 |
|
383 |
return $output;
|
384 |
}
|
402 |
$h_time = mysql2date( __( 'Y/m/d', 'flamingo' ), $m_time );
|
403 |
}
|
404 |
|
405 |
+
return '<abbr aria-label="' . $t_time . '">' . $h_time . '</abbr>';
|
406 |
}
|
407 |
}
|
admin/includes/class-outbound-messages-list-table.php
CHANGED
@@ -101,7 +101,7 @@ class Flamingo_Outbound_Messages_List_Table extends WP_List_Table {
|
|
101 |
number_format_i18n( $posts_in_inbox ) );
|
102 |
|
103 |
$status_links['inbox'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
104 |
-
|
105 |
( $this->is_trash ) ? '' : ' class="current"',
|
106 |
$inbox );
|
107 |
|
@@ -120,7 +120,12 @@ class Flamingo_Outbound_Messages_List_Table extends WP_List_Table {
|
|
120 |
number_format_i18n( $posts_in_trash ) );
|
121 |
|
122 |
$status_links['trash'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
124 |
'trash' == $post_status ? ' class="current"' : '',
|
125 |
$trash );
|
126 |
|
@@ -196,9 +201,14 @@ class Flamingo_Outbound_Messages_List_Table extends WP_List_Table {
|
|
196 |
|
197 |
$actions = array();
|
198 |
$post_id = absint( $item->id );
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
202 |
|
203 |
if ( current_user_can( 'flamingo_edit_outbound_message', $post_id ) ) {
|
204 |
$actions['edit'] = sprintf( '<a href="%1$s">%2$s</a>',
|
@@ -206,7 +216,7 @@ class Flamingo_Outbound_Messages_List_Table extends WP_List_Table {
|
|
206 |
}
|
207 |
|
208 |
if ( current_user_can( 'flamingo_edit_outbound_message', $post_id ) ) {
|
209 |
-
return sprintf( '<strong><a class="row-title" href="%1$s"
|
210 |
esc_url( $edit_link ),
|
211 |
esc_attr( sprintf( __( 'Edit “%s”', 'flamingo' ), $item->subject ) ),
|
212 |
esc_html( $item->subject ),
|
@@ -241,6 +251,6 @@ class Flamingo_Outbound_Messages_List_Table extends WP_List_Table {
|
|
241 |
$h_time = mysql2date( __( 'Y/m/d', 'flamingo' ), $m_time );
|
242 |
}
|
243 |
|
244 |
-
return '<abbr
|
245 |
}
|
246 |
}
|
101 |
number_format_i18n( $posts_in_inbox ) );
|
102 |
|
103 |
$status_links['inbox'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
104 |
+
menu_page_url( 'flamingo_outbound', false ),
|
105 |
( $this->is_trash ) ? '' : ' class="current"',
|
106 |
$inbox );
|
107 |
|
120 |
number_format_i18n( $posts_in_trash ) );
|
121 |
|
122 |
$status_links['trash'] = sprintf( '<a href="%1$s"%2$s>%3$s</a>',
|
123 |
+
esc_url( add_query_arg(
|
124 |
+
array(
|
125 |
+
'post_status' => 'trash',
|
126 |
+
),
|
127 |
+
menu_page_url( 'flamingo_outbound', false )
|
128 |
+
) ),
|
129 |
'trash' == $post_status ? ' class="current"' : '',
|
130 |
$trash );
|
131 |
|
201 |
|
202 |
$actions = array();
|
203 |
$post_id = absint( $item->id );
|
204 |
+
|
205 |
+
$edit_link = add_query_arg(
|
206 |
+
array(
|
207 |
+
'post' => $post_id,
|
208 |
+
'action' => 'edit',
|
209 |
+
),
|
210 |
+
menu_page_url( 'flamingo_outbound', false )
|
211 |
+
);
|
212 |
|
213 |
if ( current_user_can( 'flamingo_edit_outbound_message', $post_id ) ) {
|
214 |
$actions['edit'] = sprintf( '<a href="%1$s">%2$s</a>',
|
216 |
}
|
217 |
|
218 |
if ( current_user_can( 'flamingo_edit_outbound_message', $post_id ) ) {
|
219 |
+
return sprintf( '<strong><a class="row-title" href="%1$s" aria-label="%2$s">%3$s</a></strong> %4$s',
|
220 |
esc_url( $edit_link ),
|
221 |
esc_attr( sprintf( __( 'Edit “%s”', 'flamingo' ), $item->subject ) ),
|
222 |
esc_html( $item->subject ),
|
251 |
$h_time = mysql2date( __( 'Y/m/d', 'flamingo' ), $m_time );
|
252 |
}
|
253 |
|
254 |
+
return '<abbr aria-label="' . $t_time . '">' . $h_time . '</abbr>';
|
255 |
}
|
256 |
}
|
admin/includes/meta-boxes.php
CHANGED
@@ -10,11 +10,17 @@ function flamingo_contact_submit_meta_box( $post ) {
|
|
10 |
if ( current_user_can( 'flamingo_delete_contact', $post->id ) ) {
|
11 |
$delete_text = __( 'Delete', 'flamingo' );
|
12 |
|
13 |
-
$delete_link =
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
$delete_link = wp_nonce_url( $delete_link, 'flamingo-delete-contact_' . $post->id );
|
16 |
|
17 |
-
?><a class="submitdelete deletion" href="<?php echo $delete_link; ?>" onclick="if (confirm('<?php echo esc_js( sprintf( __( "You are about to delete this contact '%s'\n 'Cancel' to stop, 'OK' to delete." ), $post->email ) ); ?>')) {return true;} return false;"><?php echo esc_html( $delete_text ); ?></a><?php } ?>
|
18 |
</div>
|
19 |
|
20 |
<div id="publishing-action">
|
@@ -105,10 +111,33 @@ function flamingo_contact_tags_meta_box( $post ) {
|
|
105 |
|
106 |
function flamingo_inbound_submit_meta_box( $post ) {
|
107 |
?>
|
108 |
-
<div class="submitbox" id="
|
109 |
-
<div id="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
-
<div
|
|
|
|
|
|
|
|
|
112 |
<?php
|
113 |
if ( current_user_can( 'flamingo_delete_inbound_message', $post->id ) ) {
|
114 |
if ( ! EMPTY_TRASH_DAYS ) {
|
@@ -117,27 +146,33 @@ function flamingo_inbound_submit_meta_box( $post ) {
|
|
117 |
$delete_text = __( 'Move to Trash', 'flamingo' );
|
118 |
}
|
119 |
|
120 |
-
$delete_link =
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
$delete_link = wp_nonce_url( $delete_link,
|
123 |
'flamingo-trash-inbound-message_' . $post->id );
|
124 |
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
-
<div id="publishing-action">
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
<input disabled="disabled" name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php echo esc_attr( __( 'Add Message', 'flamingo' ) ); ?>" />
|
134 |
-
<?php endif; ?>
|
135 |
-
</div>
|
136 |
|
137 |
-
<div class="clear"></div>
|
138 |
</div><!-- #major-publishing-actions -->
|
139 |
-
|
140 |
-
<div class="clear"></div>
|
141 |
</div>
|
142 |
<?php
|
143 |
}
|
@@ -260,12 +295,18 @@ function flamingo_outbound_submit_meta_box( $post ) {
|
|
260 |
$delete_text = __( 'Move to Trash', 'flamingo' );
|
261 |
}
|
262 |
|
263 |
-
$delete_link =
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
$delete_link = wp_nonce_url( $delete_link,
|
266 |
'flamingo-trash-outbound-message_' . $post->id );
|
267 |
|
268 |
-
?><a class="submitdelete deletion" href="<?php echo $delete_link; ?>"><?php echo esc_html( $delete_text ); ?></a><?php } ?>
|
269 |
</div>
|
270 |
<?php endif; ?>
|
271 |
|
10 |
if ( current_user_can( 'flamingo_delete_contact', $post->id ) ) {
|
11 |
$delete_text = __( 'Delete', 'flamingo' );
|
12 |
|
13 |
+
$delete_link = add_query_arg(
|
14 |
+
array(
|
15 |
+
'post' => $post->id,
|
16 |
+
'action' => 'delete',
|
17 |
+
),
|
18 |
+
menu_page_url( 'flamingo', false )
|
19 |
+
);
|
20 |
+
|
21 |
$delete_link = wp_nonce_url( $delete_link, 'flamingo-delete-contact_' . $post->id );
|
22 |
|
23 |
+
?><a class="submitdelete deletion" href="<?php echo esc_url( $delete_link ); ?>" onclick="if (confirm('<?php echo esc_js( sprintf( __( "You are about to delete this contact '%s'\n 'Cancel' to stop, 'OK' to delete." ), $post->email ) ); ?>')) {return true;} return false;"><?php echo esc_html( $delete_text ); ?></a><?php } ?>
|
24 |
</div>
|
25 |
|
26 |
<div id="publishing-action">
|
111 |
|
112 |
function flamingo_inbound_submit_meta_box( $post ) {
|
113 |
?>
|
114 |
+
<div class="submitbox" id="submitinbound">
|
115 |
+
<div id="minor-publishing">
|
116 |
+
<div id="misc-publishing-actions">
|
117 |
+
<fieldset class="misc-pub-section" id="comment-status-radio">
|
118 |
+
<legend class="screen-reader-text"><?php echo esc_html( __( 'Inbound message status', 'flamingo' ) ); ?></legend>
|
119 |
+
<label><input type="radio"<?php checked( $post->spam, true ); ?> name="inbound[status]" value="spam" /><?php echo esc_html( __( 'Spam', 'flamingo' ) ); ?></label><br />
|
120 |
+
<label><input type="radio"<?php checked( $post->spam, false ); ?> name="inbound[status]" value="ham" /><?php echo esc_html( __( 'Not Spam', 'flamingo' ) ); ?></label>
|
121 |
+
</fieldset>
|
122 |
+
|
123 |
+
<div class="misc-pub-section curtime misc-pub-curtime">
|
124 |
+
<span id="timestamp">
|
125 |
+
<?php
|
126 |
+
echo sprintf(
|
127 |
+
/* translators: %s: message submission date */
|
128 |
+
esc_html( __( 'Submitted on: %s', 'flamingo' ) ),
|
129 |
+
'<b>' . esc_html( $post->date ) . '</b>'
|
130 |
+
);
|
131 |
+
?>
|
132 |
+
</span>
|
133 |
+
</div>
|
134 |
+
</div><!-- #misc-publishing-actions -->
|
135 |
|
136 |
+
<div class="clear"></div>
|
137 |
+
</div><!-- #minor-publishing -->
|
138 |
+
|
139 |
+
<div id="major-publishing-actions">
|
140 |
+
<div id="delete-action">
|
141 |
<?php
|
142 |
if ( current_user_can( 'flamingo_delete_inbound_message', $post->id ) ) {
|
143 |
if ( ! EMPTY_TRASH_DAYS ) {
|
146 |
$delete_text = __( 'Move to Trash', 'flamingo' );
|
147 |
}
|
148 |
|
149 |
+
$delete_link = add_query_arg(
|
150 |
+
array(
|
151 |
+
'post' => $post->id,
|
152 |
+
'action' => 'trash',
|
153 |
+
),
|
154 |
+
menu_page_url( 'flamingo_inbound', false )
|
155 |
+
);
|
156 |
+
|
157 |
$delete_link = wp_nonce_url( $delete_link,
|
158 |
'flamingo-trash-inbound-message_' . $post->id );
|
159 |
|
160 |
+
echo sprintf( '<a href="%1$s" class="submitdelete deletion">%2$s</a>',
|
161 |
+
esc_url( $delete_link ),
|
162 |
+
esc_html( $delete_text )
|
163 |
+
);
|
164 |
+
}
|
165 |
+
?>
|
166 |
+
</div>
|
167 |
|
168 |
+
<div id="publishing-action">
|
169 |
+
<?php
|
170 |
+
submit_button( __( 'Update', 'flamingo' ), 'primary large', 'save', false );
|
171 |
+
?>
|
172 |
+
</div>
|
|
|
|
|
|
|
173 |
|
174 |
+
<div class="clear"></div>
|
175 |
</div><!-- #major-publishing-actions -->
|
|
|
|
|
176 |
</div>
|
177 |
<?php
|
178 |
}
|
295 |
$delete_text = __( 'Move to Trash', 'flamingo' );
|
296 |
}
|
297 |
|
298 |
+
$delete_link = add_query_arg(
|
299 |
+
array(
|
300 |
+
'post' => $post->id,
|
301 |
+
'action' => 'trash',
|
302 |
+
),
|
303 |
+
menu_page_url( 'flamingo_outbound', false )
|
304 |
+
);
|
305 |
+
|
306 |
$delete_link = wp_nonce_url( $delete_link,
|
307 |
'flamingo-trash-outbound-message_' . $post->id );
|
308 |
|
309 |
+
?><a class="submitdelete deletion" href="<?php echo esc_url( $delete_link ); ?>"><?php echo esc_html( $delete_text ); ?></a><?php } ?>
|
310 |
</div>
|
311 |
<?php endif; ?>
|
312 |
|
admin/includes/privacy.php
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
add_filter( 'wp_privacy_personal_data_erasers',
|
4 |
+
'flamingo_privacy_register_personal_data_erasers', 10, 1 );
|
5 |
+
|
6 |
+
function flamingo_privacy_register_personal_data_erasers( $erasers ) {
|
7 |
+
return array_merge( (array) $erasers, array(
|
8 |
+
'flamingo-contact' => array(
|
9 |
+
'eraser_friendly_name' => __( 'Flamingo Address Book', 'flamingo' ),
|
10 |
+
'callback' => 'flamingo_privacy_contact_eraser',
|
11 |
+
),
|
12 |
+
'flamingo-inbound' => array(
|
13 |
+
'eraser_friendly_name' => __( 'Flamingo Inbound Messages', 'flamingo' ),
|
14 |
+
'callback' => 'flamingo_privacy_inbound_eraser',
|
15 |
+
),
|
16 |
+
) );
|
17 |
+
}
|
18 |
+
|
19 |
+
function flamingo_privacy_contact_eraser( $email_address, $page = 1 ) {
|
20 |
+
$number = 100;
|
21 |
+
|
22 |
+
$posts = Flamingo_Contact::find( array(
|
23 |
+
'meta_key' => '_email',
|
24 |
+
'meta_value' => $email_address,
|
25 |
+
'posts_per_page' => $number,
|
26 |
+
'paged' => (int) $page,
|
27 |
+
) );
|
28 |
+
|
29 |
+
$items_removed = false;
|
30 |
+
$items_retained = false;
|
31 |
+
$messages = array();
|
32 |
+
|
33 |
+
foreach ( (array) $posts as $post ) {
|
34 |
+
if ( ! current_user_can( 'flamingo_delete_contact', $post->id ) ) {
|
35 |
+
$items_retained = true;
|
36 |
+
|
37 |
+
$messages = array(
|
38 |
+
__( "Flamingo Address Book: You are not allowed to delete contact data.", 'flamingo' ),
|
39 |
+
);
|
40 |
+
|
41 |
+
continue;
|
42 |
+
}
|
43 |
+
|
44 |
+
if ( $post->delete() ) {
|
45 |
+
$items_removed = true;
|
46 |
+
} else {
|
47 |
+
$items_retained = true;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
$done = Flamingo_Contact::$found_items < $number;
|
52 |
+
|
53 |
+
return array(
|
54 |
+
'items_removed' => $items_removed,
|
55 |
+
'items_retained' => $items_retained,
|
56 |
+
'messages' => array_map( 'esc_html', (array) $messages ),
|
57 |
+
'done' => $done,
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
function flamingo_privacy_inbound_eraser( $email_address, $page = 1 ) {
|
62 |
+
$number = 100;
|
63 |
+
|
64 |
+
$posts = Flamingo_Inbound_Message::find( array(
|
65 |
+
'meta_key' => '_from_email',
|
66 |
+
'meta_value' => $email_address,
|
67 |
+
'posts_per_page' => $number,
|
68 |
+
'paged' => (int) $page,
|
69 |
+
) );
|
70 |
+
|
71 |
+
$items_removed = false;
|
72 |
+
$items_retained = false;
|
73 |
+
$messages = array();
|
74 |
+
|
75 |
+
foreach ( (array) $posts as $post ) {
|
76 |
+
if ( ! current_user_can( 'flamingo_delete_inbound_message', $post->id ) ) {
|
77 |
+
$items_retained = true;
|
78 |
+
|
79 |
+
$messages = array(
|
80 |
+
__( "Flamingo Inbound Messages: You are not allowed to delete inbound messages.", 'flamingo' ),
|
81 |
+
);
|
82 |
+
|
83 |
+
continue;
|
84 |
+
}
|
85 |
+
|
86 |
+
if ( $post->delete() ) {
|
87 |
+
$items_removed = true;
|
88 |
+
} else {
|
89 |
+
$items_retained = true;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
$done = Flamingo_Inbound_Message::$found_items < $number;
|
94 |
+
|
95 |
+
return array(
|
96 |
+
'items_removed' => $items_removed,
|
97 |
+
'items_retained' => $items_retained,
|
98 |
+
'messages' => array_map( 'esc_html', (array) $messages ),
|
99 |
+
'done' => $done,
|
100 |
+
);
|
101 |
+
}
|
flamingo.php
CHANGED
@@ -5,10 +5,10 @@ Description: A trustworthy message storage plugin for Contact Form 7.
|
|
5 |
Author: Takayuki Miyoshi
|
6 |
Text Domain: flamingo
|
7 |
Domain Path: /languages/
|
8 |
-
Version: 1.
|
9 |
*/
|
10 |
|
11 |
-
define( 'FLAMINGO_VERSION', '1.
|
12 |
|
13 |
define( 'FLAMINGO_PLUGIN', __FILE__ );
|
14 |
|
5 |
Author: Takayuki Miyoshi
|
6 |
Text Domain: flamingo
|
7 |
Domain Path: /languages/
|
8 |
+
Version: 1.9
|
9 |
*/
|
10 |
|
11 |
+
define( 'FLAMINGO_VERSION', '1.9' );
|
12 |
|
13 |
define( 'FLAMINGO_PLUGIN', __FILE__ );
|
14 |
|
includes/akismet.php
CHANGED
@@ -30,5 +30,9 @@ function flamingo_akismet_submit( $comment, $as = 'spam' ) {
|
|
30 |
}
|
31 |
|
32 |
function flamingo_akismet_is_active() {
|
33 |
-
|
|
|
|
|
|
|
|
|
34 |
}
|
30 |
}
|
31 |
|
32 |
function flamingo_akismet_is_active() {
|
33 |
+
if ( is_callable( array( 'Akismet', 'get_api_key' ) ) ) {
|
34 |
+
return (bool) Akismet::get_api_key();
|
35 |
+
}
|
36 |
+
|
37 |
+
return false;
|
38 |
}
|
includes/class-inbound-message.php
CHANGED
@@ -157,7 +157,8 @@ class Flamingo_Inbound_Message {
|
|
157 |
$this->id = $post->ID;
|
158 |
|
159 |
$this->date = get_the_time(
|
160 |
-
|
|
|
161 |
$this->subject = get_post_meta( $post->ID, '_subject', true );
|
162 |
$this->from = get_post_meta( $post->ID, '_from', true );
|
163 |
$this->from_name = get_post_meta( $post->ID, '_from_name', true );
|
@@ -200,10 +201,15 @@ class Flamingo_Inbound_Message {
|
|
200 |
$post_title = __( '(No Title)', 'flamingo' );
|
201 |
}
|
202 |
|
203 |
-
$
|
204 |
-
|
|
|
|
|
|
|
205 |
|
206 |
-
$post_content =
|
|
|
|
|
207 |
|
208 |
$post_status = $this->spam ? self::spam_status : 'publish';
|
209 |
|
157 |
$this->id = $post->ID;
|
158 |
|
159 |
$this->date = get_the_time(
|
160 |
+
/* translators: date format, see https://php.net/date */
|
161 |
+
__( 'M j, Y @ H:i', 'flamingo' ), $this->id );
|
162 |
$this->subject = get_post_meta( $post->ID, '_subject', true );
|
163 |
$this->from = get_post_meta( $post->ID, '_from', true );
|
164 |
$this->from_name = get_post_meta( $post->ID, '_from_name', true );
|
201 |
$post_title = __( '(No Title)', 'flamingo' );
|
202 |
}
|
203 |
|
204 |
+
$post_content = array_merge(
|
205 |
+
$this->fields,
|
206 |
+
$this->consent,
|
207 |
+
$this->meta
|
208 |
+
);
|
209 |
|
210 |
+
$post_content = flamingo_array_flatten( $post_content );
|
211 |
+
$post_content = array_filter( array_map( 'trim', $post_content ) );
|
212 |
+
$post_content = implode( "\n", $post_content );
|
213 |
|
214 |
$post_status = $this->spam ? self::spam_status : 'publish';
|
215 |
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Flamingo ===
|
2 |
Contributors: takayukister, megumithemes
|
3 |
Tags: bird, contact, mail, crm
|
4 |
-
Requires at least: 4.
|
5 |
-
Tested up to: 4.9
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -17,6 +17,10 @@ After activation of the plugin, you'll find *Flamingo* on the WordPress admin sc
|
|
17 |
|
18 |
For more detailed information, please refer to the [Contact Form 7 documentation page](https://contactform7.com/save-submitted-messages-with-flamingo/).
|
19 |
|
|
|
|
|
|
|
|
|
20 |
== Installation ==
|
21 |
|
22 |
1. Upload the entire `flamingo` folder to the `/wp-content/plugins/` directory.
|
@@ -28,13 +32,13 @@ For more detailed information, please refer to the [Contact Form 7 documentation
|
|
28 |
|
29 |
== Changelog ==
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
= 1.8 =
|
32 |
|
33 |
* Remove support for outdated Akismet APIs.
|
34 |
* Take consent data through an inbound message.
|
35 |
-
|
36 |
-
= 1.7 =
|
37 |
-
|
38 |
-
* New filter: flamingo_add_inbound
|
39 |
-
* New filter: flamingo_add_contact
|
40 |
-
* New filter: flamingo_htmlize
|
1 |
=== Flamingo ===
|
2 |
Contributors: takayukister, megumithemes
|
3 |
Tags: bird, contact, mail, crm
|
4 |
+
Requires at least: 4.9
|
5 |
+
Tested up to: 4.9
|
6 |
+
Stable tag: 1.9
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
17 |
|
18 |
For more detailed information, please refer to the [Contact Form 7 documentation page](https://contactform7.com/save-submitted-messages-with-flamingo/).
|
19 |
|
20 |
+
= Privacy Notices =
|
21 |
+
|
22 |
+
This plugin stores submission data collected through contact forms, which may include the submitters' personal information, in the database on the server that hosts the website.
|
23 |
+
|
24 |
== Installation ==
|
25 |
|
26 |
1. Upload the entire `flamingo` folder to the `/wp-content/plugins/` directory.
|
32 |
|
33 |
== Changelog ==
|
34 |
|
35 |
+
= 1.9 =
|
36 |
+
|
37 |
+
* The admin screen UI has been updated.
|
38 |
+
* Enables to search Inbound Messages by keywords used in the Consent and Meta sections.
|
39 |
+
* Introduces personal data eraser for Address Book and Inbound Messages data.
|
40 |
+
|
41 |
= 1.8 =
|
42 |
|
43 |
* Remove support for outdated Akismet APIs.
|
44 |
* Take consent data through an inbound message.
|
|
|
|
|
|
|
|
|
|
|
|