apply_filters ( 'jetpack_is_holiday_snow_season', bool $snow )

Filter whether it's winter or not.<p>You can use this filter if, for example, you live in the Southern Hemisphere. In that case, the dates for winter above are incorrect for your location.</p>

Source file: modules/holiday-snow.php

View in GitHub

Parameters

$snow

(bool) True if it’s snow season, false if not.


Changelog

Since: Jetpack 2.1.0


Notes

You can use this filter to change when Snow starts falling on your site, and when it ends. In the example below, we’ll have snow falling on our site until April 1st:

/**
 * Show the Snow option until April 1st.
 *
 * By default, the option disappears on January 4th
 *
 * @return bool true|false Is it holiday season?
 */
function jeherve_snow_fools() {
    $today          = time();
    // First snow day. December 1st here.
    $first_snow_day = mktime( 0, 0, 0, 12, 1 );
    // Last Snow day. April 1st in our example.
    $last_snow_day  = mktime( 0, 0, 0, 4, 1 );
 
    // $snow will return false if we're outside holiday season.
    $snow = ( $today >= $first_snow_day || $today < $last_snow_day );
 
    return $snow;
}
add_filter( 'jetpack_is_holiday_snow_season', 'jeherve_snow_fools' );

Have a note to contribute?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s