Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #61746


Ignore:
Timestamp:
10/04/2024 03:44:03 PM (7 months ago)
Author:
hellofromTonya
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #61746 – Description

    initial v2  
     1The `'login_redirect'` hook is not work in WordPress version 6.1.1.
     2
     3I set default themes.
     4{{{
     5
     6// Hook into the login_redirect filter
     7add_filter('login_redirect', 'custom_login_redirect', 10, 3);
     8
     9function custom_login_redirect($redirect_to, $request, $user) {
     10   
     11        return home_url('/dashboard/');
     12
     13}
     14
     15}}}
     16
     17
     18
     19
     20{{{
    121if ( isset( $_POST['action'] ) && $_POST['action'] == 'log-in' ) {
    222
     
    2747
    2848<form action="" method="post" class="sign-in">
    29                                     <div class="form_group">
    30                                         <label for="user_login"><?php _e('Username'); ?></label>
     49        <div class="form_group">
     50                <label for="user_login"><?php _e('Username'); ?></label>
    3151                                       
    32                                         <input type="text" name="user_login" class="input_control" id="user_login" value="" />
    33                                     </div>
    34                                     <div class="form_group">
    35                                         <label for="password"><?php _e('Password'); ?></label>
    36                                         <input type="password" class="input_control" name="password" id="password" />
    37                                     </div>
    38                                     <div class="forgot"><a href="<?php echo site_url(); ?>/forgot-password/">Forgot Password?</a></div>
    39                                     <div class="form_footer">
    40                                         <button type="submit"><?php _e('Log in'); ?></button>
    41                                         <input type="hidden" name="action" value="log-in" />
    42                                     </div>
    43                                 </form>
     52                <input type="text" name="user_login" class="input_control" id="user_login" value="" />
     53        </div>
     54        <div class="form_group">
     55                <label for="password"><?php _e('Password'); ?></label>
     56                <input type="password" class="input_control" name="password" id="password" />
     57        </div>
     58        <div class="forgot"><a href="<?php echo site_url(); ?>/forgot-password/">Forgot Password?</a></div>
     59        <div class="form_footer">
     60                <button type="submit"><?php _e('Log in'); ?></button>
     61                <input type="hidden" name="action" value="log-in" />
     62        </div>
     63</form>
     64}}}