Add session or cookie to remember last menu location

Unfortunately, since we aren’t able to see any of your current code, and it’s sort of a vague description of your implementation, it’ll be difficult for anyone to post actual code that will work for you. But to point you to some resources that might help, you might find these helpful: W3 Schools – PHP … Read more

Error when setting cookie

You set the cookie too late. You can use any action before template_include to set a cookie, after that there is already HTML output, and no further headers can be set. Example: add_action( ‘template_redirect’, function() { setcookie( ‘test’, 1 ); });

WordPress Website with Login system

Okay, here is a simple example. init action loads before loading WordPress website. So we can use it to check some special conditions for allowing access to users. You should use this in functions.php function user_custom_redirect() { if ( ‘something’ === ‘something else’ ) { // let user view WordPress website } else { // … Read more

PHP session when called wp_ajax_nopriv

WordPress does not use or affect PHP Sessions in any way. Therefore, the session functions will work exactly the same whether you’re using WordPress or plain PHP or AJAX requests or anything else. However, PHP Sessions depend very heavily on your specific PHP configuration. If you don’t have the PHP Session settings configured correctly in … Read more

Where is function to prevents non logged users access wp-admin?

You will need to use the authenticate filter: https://codex.wordpress.org/Plugin_API/Filter_Reference/authenticate add_filter( ‘authenticate’, ‘myplugin_auth_signon’, 30, 3 ); function myplugin_auth_signon( $user, $username, $password ) { return $user; } Return a WP_Error object to indicate failure or an issue, or a WP_User object on success. There are also 2 core functions hooked into that filter that will need removing … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)