PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.7.2
VikBooking Hotel Booking Engine & PMS v1.7.2
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
vikbooking / libraries / adapter / usergroups / helper.php

helper.php in VikBooking Hotel Booking Engine & PMS 1.7.2, at libraries/adapter/usergroups/helper.php

72 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package VikWP - Libraries
4 * @subpackage adapter.user
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2023 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 /**
15 * Helper to deal with user groups.
16 *
17 * @since 10.1.30
18 */
19 final class JHelperUsergroups
20 {
21 /**
22 * Singleton instance.
23 *
24 * @var UserGroupsHelper
25 */
26 private static $instance = null;
27
28 /**
29 * Available user groups
30 *
31 * @var array
32 */
33 private $groups = array();
34
35 /**
36 * Get the helper instance.
37 *
38 * @return self
39 */
40 public static function getInstance()
41 {
42 if (static::$instance === null)
43 {
44 static::$instance = new static();
45 }
46
47 return static::$instance;
48 }
49
50 /**
51 * Get the list of existing user groups.
52 *
53 * @return array
54 */
55 public function getAll()
56 {
57 $this->groups = array();
58
59 foreach (wp_roles()->roles as $slug => $role)
60 {
61 $tmp = new stdClass;
62
63 $tmp->id = $slug;
64 $tmp->title = $role['name'];
65
66 $this->groups[$slug] = $tmp;
67 }
68
69 return $this->groups;
70 }
71 }
72