Skip to content

Instantly share code, notes, and snippets.

@szbl
Created December 20, 2012 02:39
Show Gist options
  • Save szbl/4342524 to your computer and use it in GitHub Desktop.
Save szbl/4342524 to your computer and use it in GitHub Desktop.
<?php
function rkv_login_stringcheck()
{
global $pagenow;
if ( $pagenow == 'wp-login.php' )
{
// set the location a failed attempt goes to
$redirect = 'http://www.google.com/';
// missing query string all together
if (!isset ($_GET['question']) )
wp_redirect( esc_url_raw ($redirect), 302 );
// incorrect value for query string
if ($_GET['question'] !== 'answer' )
wp_redirect( esc_url_raw ($redirect), 302 );
}
}
add_action( 'init', 'rkv_login_stringcheck' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment