Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created January 17, 2012 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save whyisjake/1629717 to your computer and use it in GitHub Desktop.
Save whyisjake/1629717 to your computer and use it in GitHub Desktop.
SOPA Redirect
add_action( 'init', 'make_sopa_blackout' );
function make_sopa_blackout() {
if ( ! is_admin() ) {
$current_time = current_time( 'timestamp' );
$start_time = strtotime( '01/17/2012 8:00' );
$end_time = strtotime( '01/17/2012 20:00' );
if( $current_time >= $start_time && $current_time <= $end_time ) {
wp_redirect( 'http://oreilly.com/make-blackout.html', 503 );
exit;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment