summaryrefslogtreecommitdiff
path: root/Postman/Postman-Email-Log/PostmanEmailLogView.php
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2017-12-05 21:53:16 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2017-12-05 21:53:16 +0000
commit82f78770cb8c6058bf506db617ed95c21e3c7b0a (patch)
treeb33b8a3d3eb8eac9fe6f8272f62e626ea4de0623 /Postman/Postman-Email-Log/PostmanEmailLogView.php
parent362ab9579ed96c1ec9b24b9c0f4097081ba3516f (diff)
downloadPost-SMTP-82f78770cb8c6058bf506db617ed95c21e3c7b0a.zip
* Welcome on activation
* email log records per page * email logs trash all * remove gmail hosts for non gmail host
Diffstat (limited to 'Postman/Postman-Email-Log/PostmanEmailLogView.php')
-rw-r--r--Postman/Postman-Email-Log/PostmanEmailLogView.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/Postman/Postman-Email-Log/PostmanEmailLogView.php b/Postman/Postman-Email-Log/PostmanEmailLogView.php
index fe0fdfe..1d8c4b1 100644
--- a/Postman/Postman-Email-Log/PostmanEmailLogView.php
+++ b/Postman/Postman-Email-Log/PostmanEmailLogView.php
@@ -305,8 +305,10 @@ class PostmanEmailLogView extends WP_List_Table {
* be able to use your precisely-queried data immediately.
*/
$data = array();
+ $posts_per_page = absint( $_POST['postman_page_records'] );
+
$args = array(
- 'posts_per_page' => 1000,
+ 'posts_per_page' => $posts_per_page,
'offset' => 0,
'orderby' => 'date',
'order' => 'DESC',
@@ -339,7 +341,19 @@ class PostmanEmailLogView extends WP_List_Table {
$args['s'] = sanitize_text_field( $_POST['search'] );
}
+ if ( isset( $_POST['postman_trash_all'] ) ) {
+ $args['posts_per_page'] = -1;
+ }
$posts = new WP_query( $args );
+
+ if ( isset( $_POST['postman_trash_all'] ) ) {
+ foreach ( $posts->posts as $post ) {
+ wp_delete_post( $post->ID, true );
+ }
+
+ $posts->posts = array();
+ }
+
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );