Bypass a WordPress Password Protected Page via url
Question
In case somebody needs help about my topic, I’ve fixed the notice error by modifying the original code as following:
// BYPASS PASSWORD PRETECTED PAGE URL
add_filter( 'post_password_required', function( $returned, $post ) {
if ( !is_admin() ) {
if (strpos($_SERVER['REQUEST_URI'], 'pwd') !== false){
if( $returned && ( $_GET['pwd'] == $post->post_password ) )
$returned = false;
}
} else {
$returned = true;
}
return $returned;
}, 10, 2 );
0
6 days
2023-05-26T02:57:17-05:00
2023-05-26T02:57:17-05:00 0 Answers
0 views
0
Leave an answer