and i just noticed that it doesnt do it for every image, only most of them malfunction.
I’ve also tried this version of the plugin with no luck, again it just fails and redirects back to the home page
function doPasswordStuff(){
if(isset($_POST['homepagepassword'])){
$pass = $_POST['passwordfield'];
$q = new WP_Query( array( 'meta_key' => 'password_value', 'meta_value' => $pass));
if($q->have_posts()){
while($q->have_posts()){
$q->the_post();
wp_redirect(get_permalink());
die();
}
} else {
// oh dear, there isnt a post with this 'password', put a redirect to a fallback here
wp_redirect('http://www.google.com');
die();
}
wp_reset_query();
}
}
add_action('init','doPasswordStuff');