WP Users list

- refactored and fixed listing issues (related to Segments)
- removed bulk actions from segments
- added synchronize methods for WP users
- Update action in segments only for WP Users list
- added "type" column to segments (default, wp_users, dynamic...)
- added "status" column to subscriber_segment table (useful soon)
This commit is contained in:
Jonathan Labreuille
2015-11-25 18:31:57 +01:00
parent 6dd8270bec
commit a5d96f1534
11 changed files with 150 additions and 107 deletions

View File

@ -77,7 +77,20 @@ class Segment extends Model {
}
static function getWPUsers() {
return self::findOne(1);
$segment = self::where('type', 'wp_users')->findOne();
if($segment === false) {
// create the wp users list
$segment = self::create();
$segment->hydrate(array(
'name' => __('WordPress Users'),
'type' => 'wp_users'
));
$segment->save();
return self::findOne($segment->id());
}
return $segment;
}
static function search($orm, $search = '') {