This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wp_version; | |
if ( version_compare( $wp_version, '3.5', '>=' ) ) { | |
// WP Version 3.5.x+, do something! | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Why does this exist? http://xkcd.com/1179/ also because it makes sense to have a standard way in WordPress to work with | |
* dates and times so that plugin developers can create plugins that will work in any timezone worldwide. | |
* | |
* WordPress sets the default timezone during execution to UTC, reguardless of what the server is set to. | |
* This means that date( 'FORMAT' ) will always give you the current time in UTC, not the timezone you have set | |
* in the WP admin settings. Use date( 'FORMAT', current_time( 'timestamp' ) ) instead to get WP local time. Likewise, | |
* use current_time( 'timestamp' ) instead of time() for the local time. | |
*/ |