PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.2.10
Adminify – White Label, Admin Menu Editor, Login Customizer v4.2.10
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Classes / Developer_Hooks.php

Developer_Hooks.php in Adminify – White Label, Admin Menu Editor, Login Customizer 4.2.10, at Inc/Classes/Developer_Hooks.php

64 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly.
5 }
6
7 /**
8 * WP Adminify has some hooks for developers.
9 */
10 if ( ! class_exists( 'PXLBSAdminify_Developer_Hooks' ) ) {
11
12 /**
13 * Developer friendly hooks.
14 */
15 class PXLBSAdminify_Developer_Hooks {
16
17
18 /*
19 * * * * * * * * *
20 * Class constructor
21 * * * * * * * * * */
22 public function __construct() {
23 $this->_hooks();
24 }
25
26 public function _hooks() {
27 add_filter( 'pxlbsadminify_remember_me', [ $this, 'remember_me_callback' ], 10, 1 );
28 }
29
30 /**
31 * remember_me_callback [turn off the remember me option from WordPress login form.]
32 *
33 * @param bolean $activate
34 * @since 1.0.0
35 */
36 public function remember_me_callback( $activate ) {
37 if ( ! $activate ) {
38 return;
39 }
40
41 // Hide the "Remember Me" checkbox via CSS instead of opening
42 // an output buffer in login_form. Output buffers that are not
43 // closed in the same logical flow can desync the buffer stack
44 // when other plugins/themes also buffer output.
45 add_action( 'login_head', [ $this, 'hide_remember_me_style' ], 99 );
46 // Reset any attempt to set the remember option
47 add_action( 'login_head', [ $this, 'unset_remember_me_option' ], 99 );
48 }
49
50 function unset_remember_me_option() {
51
52 // Remove the rememberme post value
53 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- read-only check, no state change.
54 if ( isset( $_POST['rememberme'] ) ) {
55 unset( $_POST['rememberme'] );
56 }
57 }
58
59 function hide_remember_me_style() {
60 echo '<style id="wp-adminify-hide-rememberme">.forgetmenot{display:none !important;}</style>';
61 }
62 }
63 }
64