Skip to main content
2 of 2
added 320 characters in body
Balas
  • 621
  • 5
  • 17

See my updated answer, now i tried as per your condition and my url is like now

    http://www.example.com/?query=yes
    
add_action('init', 'my_cookie');

add_action('init', 'signup_validate_insert');

function signup_validate_insert() {
    if(isset($_REQUEST['query'])) {     
        $errors = 'my_error';
        setcookie("my_cookie", $errors, time()+3600);       
        wp_redirect(home_url('shortcode-9/'));
        die();
    }
}

function my_cookie() {
    if(isset($_COOKIE['my_cookie'])) {
        
        echo $_COOKIE['my_cookie'];
    }
}
    
    it is for me working nice. am i right? Reply your thoughts.
Balas
  • 621
  • 5
  • 17