Password form redirection to belonging post

Here is all you need to make this work, plus your actual form of course: function dopasswordstuff(){ if(isset($_POST[‘homepagepassword’])){ global $wpdb; $post_password = trim($_POST[‘passwordfield’]); $post_id = $wpdb->get_var( $wpdb->prepare(“SELECT ID FROM $wpdb->posts WHERE post_password = %s”, $post_password) ); if (!empty($post_id)) { wp_redirect(get_permalink($post_id)); } exit; } } add_action(‘template_redirect’,’dopasswordstuff’); I simplified your function considerably by leveraging the fact that … Read more

mysql update user’s password and activation key

You are using the user email as the user login. Your code, formatted for readability, looks like: $resetQuery = $wpdb -> query( $wpdb -> prepare( “UPDATE wp_users SET user_pass = %s, user_activation_key = ” WHERE user_login = %s AND user_activation_key = %s”, $hashedPwd, $useremail, $key ) ); The $useremail argument matches the user_login = %s … Read more

Add an access code form to call a unique page based on page without registration

If your code is truly going to be the slug (“secret-page” = example.com/secret-page), you could do something like this… wp_redirect(get_bloginfo(‘url’).”https://wordpress.stackexchange.com/”.$_POST[‘access_code’]); But realize that headers cannot have already been sent, so this needs to happen before get_header(). Some more testing would be needed, but that should get you down the right path in principle. You could … Read more

Override default password nag in WordPress

The function is hooked to an action, so you should be able to remove it. remove_action(‘admin_notices’,’default_password_nag’); You can then add back a function of your own choosing. Rename your function to something that won’t conflict with the Core function name and… add_action(‘admin_notices’,’my_password_nag’); You will need to create a plugin or mu-plugin to do it, but … Read more

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