Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Hacks
    In reply to: wp_localize_script
    [email protected]

    (@carl_eriklhotmailcom)

    Perhaps
    1. you dont call localize script after enqueue
    2. check from exactly where it has been called, perhaps try to put it in a init hook.

    kind regards
    ce

    [email protected]

    (@carl_eriklhotmailcom)

    I found a solution that helped me.

    My solution is changing in wp-login.php, yes i know I should not do that, so I was hoping someone could tell me what to do instead.

    My solution:
    change this in wp-login.php line 406

    case 'logout' :
    	check_admin_referer('logout');
    	wp_logout();
    
    	$redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true';
    	wp_safe_redirect( $redirect_to );
    	exit();
    
    break;

    change
    check_admin_referer(‘logout’);
    to
    check_admin_referer(‘log-out’);

    Reason:
    Woocommerce creates the nonce when page loads.
    calls function wp_logout_url($redirect = ”) which creates the logout url.
    in wp-includes/general-template.php

    which creates the logout_url with among other:

    $logout_url = wp_nonce_url( $logout_url, 'log-out' );

    there is the ‘log-out’, and not as expected ‘logout’.

    someone who knows more than me should figure it out.

    kind regards
    carl erik

Viewing 2 replies - 1 through 2 (of 2 total)