- Timestamp:
- 11/30/2017 11:09:33 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/customize/class-wp-customize-date-time-control.php
r42117 r42343 82 82 $data = parent::json(); 83 83 84 $data['maxYear'] = intval( $this->max_year );85 $data['minYear'] = intval( $this->min_year );86 $data['allowPastDate'] = (bool) $this->allow_past_date;84 $data['maxYear'] = intval( $this->max_year ); 85 $data['minYear'] = intval( $this->min_year ); 86 $data['allowPastDate'] = (bool) $this->allow_past_date; 87 87 $data['twelveHourFormat'] = (bool) $this->twelve_hour_format; 88 $data['includeTime'] = (bool) $this->include_time;88 $data['includeTime'] = (bool) $this->include_time; 89 89 90 90 return $data; … … 97 97 */ 98 98 public function content_template() { 99 $data = array_merge( $this->json(), $this->get_month_choices() );99 $data = array_merge( $this->json(), $this->get_month_choices() ); 100 100 $timezone_info = $this->get_timezone_info(); 101 101 … … 199 199 200 200 /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */ 201 $months[ $i ]['text'] = sprintf( __( '%1$s-%2$s' ), $i, $month_text );201 $months[ $i ]['text'] = sprintf( __( '%1$s-%2$s' ), $i, $month_text ); 202 202 $months[ $i ]['value'] = $i; 203 203 } … … 215 215 */ 216 216 public function get_timezone_info() { 217 $tz_string = get_option( 'timezone_string' );217 $tz_string = get_option( 'timezone_string' ); 218 218 $timezone_info = array(); 219 219 … … 226 226 227 227 if ( $tz ) { 228 $now = new DateTime( 'now', $tz );229 $formatted_gmt_offset = sprintf( 'UTC%s', $this->format_gmt_offset( $tz->getOffset( $now ) / 3600 ) );230 $tz_name = str_replace( '_', ' ', $tz->getName() );228 $now = new DateTime( 'now', $tz ); 229 $formatted_gmt_offset = sprintf( 'UTC%s', $this->format_gmt_offset( $tz->getOffset( $now ) / 3600 ) ); 230 $tz_name = str_replace( '_', ' ', $tz->getName() ); 231 231 $timezone_info['abbr'] = $now->format( 'T' ); 232 232 … … 237 237 } 238 238 } else { 239 $formatted_gmt_offset = $this->format_gmt_offset( intval( get_option( 'gmt_offset', 0 ) ) );239 $formatted_gmt_offset = $this->format_gmt_offset( intval( get_option( 'gmt_offset', 0 ) ) ); 240 240 $timezone_info['abbr'] = sprintf( 'UTC%s', $formatted_gmt_offset ); 241 241
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)