<?php
/*
Plugin Name: CSS Naked Day
Plugin URI: http://guff.szub.net/css-naked-day
Description: Automatically turns off stylesheet on April 5. Also provides is_naked_day() conditional for use in your templates.
Author: Kaf Oseo
Version: 1.0.1
Author URI: http://szub.net
For info on CSS Naked Day: http://www.dustindiaz.com/naked-day/
Copyright (c) 2006 Kaf Oseo (http://szub.net)
CSS Naked Day WordPress plugin is released under the GNU General
Public License (GPL) http://www.gnu.org/licenses/gpl.txt
This is a WordPress plugin (http://wordpress.org).
*/
function time_to_get_naked($text) {
if(is_Naked_Day() && $text == get_bloginfo('stylesheet_url')) {
return;
}
return $text;
}
function is_Naked_Day() {
$use_gmt_offset = 1; // use GMT offset (Options > General, Date and Time 'differ')
$start = date('U', mktime(0,0,0,04,05,date(Y)));
$end = date('U', mktime(24,0,0,04,05,date(Y)));
$now = time('U');
if($use_gmt_offset)
$offset = get_settings('gmt_offset')*60*60;
$start = $start + $offset;
$end = $end + $offset;
$now = $now + $offset;
if (($now >= $start) && ($now <= $end))
return true;
else
return false;
}
add_filter('bloginfo', 'time_to_get_naked', 5);
?>