PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0
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.0, at Inc/Classes/Developer_Hooks.php

61 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * WP Adminify has some hooks for developers.
5 */
6 if ( ! class_exists( 'WP_Adminify_Developer_Hooks' ) ) {
7
8 /**
9 * Developer friendly hooks.
10 */
11 class WP_Adminify_Developer_Hooks {
12
13
14 /*
15 * * * * * * * * *
16 * Class constructor
17 * * * * * * * * * */
18 public function __construct() {
19 $this->_hooks();
20 }
21
22 public function _hooks() {
23 add_filter( 'wp_adminify_remember_me', [ $this, 'wp_adminify_remember_me_callback' ], 10, 1 );
24 }
25
26 /**
27 * wp_adminify_remember_me_callback [turn off the remember me option from WordPress login form.]
28 *
29 * @param bolean $activate
30 * @since 1.0.0
31 */
32 public function wp_adminify_remember_me_callback( $activate ) {
33 if ( ! $activate ) {
34 return;
35 }
36
37 // Add the hook into the login_form
38 add_action( 'login_form', [ $this, 'wp_adminify_login_form' ], 99 );
39 // Reset any attempt to set the remember option
40 add_action( 'login_head', [ $this, 'unset_remember_me_option' ], 99 );
41 }
42
43 function unset_remember_me_option() {
44
45 // Remove the rememberme post value
46 if ( isset( $_POST['rememberme'] ) ) {
47 unset( $_POST['rememberme'] );
48 }
49 }
50
51 function wp_adminify_login_form() {
52 ob_start( [ $this, 'remove_forgetmenot_class' ] );
53 }
54
55 function remove_forgetmenot_class( $content ) {
56 $content = preg_replace( '/<p class="forgetmenot">(.*)<\/p>/', '', $content );
57 return $content;
58 }
59 }
60 }
61