diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2017-12-12 22:00:06 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2017-12-12 22:00:06 +0000 |
commit | 97a47666f6bf86c7cb9387eec51dae5bc2486010 (patch) | |
tree | 40db7ffcd0dab2fdaa6420955c7738ba72079665 /Postman/Postman-Email-Log | |
parent | d53ff2324d38c6fbdc0669324c3e3fa3ae6c4ca8 (diff) | |
download | Post-SMTP-97a47666f6bf86c7cb9387eec51dae5bc2486010.zip |
* MAILGUN IS ABOUT TO RELEASE
* Email log - trash all
* Email log - records per page
* Welcome page
* Fix config screen tabs
Diffstat (limited to 'Postman/Postman-Email-Log')
-rw-r--r-- | Postman/Postman-Email-Log/PostmanEmailLogController.php | 13 | ||||
-rw-r--r-- | Postman/Postman-Email-Log/PostmanEmailLogView.php | 6 |
2 files changed, 10 insertions, 9 deletions
diff --git a/Postman/Postman-Email-Log/PostmanEmailLogController.php b/Postman/Postman-Email-Log/PostmanEmailLogController.php index 3190c32..7d9337a 100644 --- a/Postman/Postman-Email-Log/PostmanEmailLogController.php +++ b/Postman/Postman-Email-Log/PostmanEmailLogController.php @@ -360,6 +360,8 @@ class PostmanEmailLogController { $from_date = isset( $_POST['from_date'] ) ? sanitize_text_field( $_POST['from_date'] ) : ''; $to_date = isset( $_POST['to_date'] ) ? sanitize_text_field( $_POST['to_date'] ) : ''; $search = isset( $_POST['search'] ) ? sanitize_text_field( $_POST['search'] ) : ''; + $page_records = apply_filters( 'postman_log_per_page', array( 10, 15, 25, 50, 75, 100 ) ); + $postman_page_records = isset( $_POST['postman_page_records'] ) ? absint( $_POST['postman_page_records'] ) : ''; ?> <form id="postman-email-log-filter" method="post"> @@ -379,11 +381,12 @@ class PostmanEmailLogController { <div class="form-control"> <label id="postman_page_records"><?php _e( 'Records per page', Postman::TEXT_DOMAIN ); ?></label> <select id="postman_page_records" name="postman_page_records"> - <option value="10">10</option> - <option value="25">25</option> - <option value="50">50</option> - <option value="75">75</option> - <option value="100">100</option> + <?php + foreach ( $page_records as $value ) { + $selected = selected( $postman_page_records, $value, false ); + echo '<option value="' . $value . '"' . $selected . '>' . $value . '</option>'; + } + ?> </select> </div> <div class="form-control" style="padding: 0 5px 0 5px;"> diff --git a/Postman/Postman-Email-Log/PostmanEmailLogView.php b/Postman/Postman-Email-Log/PostmanEmailLogView.php index 1d8c4b1..2fb3f72 100644 --- a/Postman/Postman-Email-Log/PostmanEmailLogView.php +++ b/Postman/Postman-Email-Log/PostmanEmailLogView.php @@ -260,7 +260,7 @@ class PostmanEmailLogView extends WP_List_Table { /** * First, lets decide how many records per page to show */ - $per_page = 10; + $per_page = isset( $_POST['postman_page_records'] ) ? absint( $_POST['postman_page_records'] ) : 10; /** * REQUIRED. @@ -305,11 +305,9 @@ 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' => $posts_per_page, - 'offset' => 0, + 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => PostmanEmailLogPostType::POSTMAN_CUSTOM_POST_TYPE_SLUG, |