wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_timezone_override_offset › WordPress Function
Depuis2.8.0
Dépréciéen/a
› wp_timezone_override_offset ( Pas de paramètres )
Retourne: |
|
Défini(e) dans: |
|
Codex: |
Modifies gmt_offset for smart timezone handling.
Overrides the gmt_offset option if we have a timezone_string available.Fonctions en relation: iso8601_timezone_to_offset, wp_timezone_choice, wp_timezone_string, _wp_timezone_choice_usort_callback, wp_timezone_supported
Source
function wp_timezone_override_offset() { $timezone_string = get_option( 'timezone_string' ); if ( ! $timezone_string ) { return false; } $timezone_object = timezone_open( $timezone_string ); $datetime_object = date_create(); if ( false === $timezone_object || false === $datetime_object ) { return false; } return round( timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS, 2 ); }