PluginProbe
Sessions / 2.3.1
Sessions v2.3.1
2.1.0 2.10.0 2.11.0 2.12.0 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.2.0 2.3.0 2.3.1 2.4.0 2.4.1 2.5.0 2.6.0 2.6.1 2.6.2 2.7.0 2.8.0 2.9.0 2.9.1 3.0.0 3.1.0 3.1.1 All 39 releases
sessions / includes / features / class-useradministration.php

class-useradministration.php in Sessions 2.3.1, at includes/features/class-useradministration.php

49 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * User admin handling.
4 *
5 * Handles all user admin operations.
6 *
7 * @package Features
8 * @author Pierre Lannoy <https://pierre.lannoy.fr/>.
9 * @since 1.0.0
10 */
11
12 namespace POSessions\Plugin\Feature;
13 use POSessions\System\Session;
14
15 /**
16 * Define the user admin functionality.
17 *
18 * Handles all user admin operations.
19 *
20 * @package Features
21 * @author Pierre Lannoy <https://pierre.lannoy.fr/>.
22 * @since 1.0.0
23 */
24 class UserAdministration {
25
26 /**
27 * Initialize the meta class and set its properties.
28 *
29 * @since 1.0.0
30 */
31 public static function init() {
32 add_action( 'show_user_profile', [ self::class, 'user_profile' ], 0 );
33 add_action( 'edit_user_profile', [ self::class, 'user_profile' ], 0 );
34 }
35
36 /**
37 * Echo the 'Sessions Management' section of the user profile.
38 *
39 * @param \WP_User $user The user.
40 * @since 1.0.0
41 */
42 public static function user_profile( $user ) {
43 $session = new Session( $user );
44 if ( $session->is_needed() ) {
45 include POSE_ADMIN_DIR . 'partials/sessions-admin-user-profile.php';
46 }
47 }
48
49 }