Subscribers Listing

- sortable
- searchable
This commit is contained in:
Jonathan Labreuille
2015-08-24 18:49:52 +02:00
committed by marco
parent 3c46c3cd3a
commit f721119c9f
3 changed files with 130 additions and 66 deletions

View File

@@ -9,17 +9,7 @@ class Subscribers {
}
function get() {
if(isset($_POST['data'])) {
// search filter
$search = (isset($_POST['data']['search']))
? $_POST['data']['search']
: '';
$collection = Subscriber::where_like('email', '%'.$search.'%')->find_array();
} else {
$collection = Subscriber::find_array();
}
$collection = Subscriber::find_array();
wp_send_json($collection);
}