Plugin Directory

Changeset 2014841


Ignore:
Timestamp:
01/18/2019 01:10:03 PM (7 years ago)
Author:
wpklangoo
Message:

Adjusting dates to reflect UTC timezones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • magnet/trunk/WP-klangoo.php

    r2014165 r2014841  
    5050            <meta itemprop="description" content="<?php echo esc_attr( magnet_get_excerpt( get_the_ID() ) ); ?>"/>
    5151            <meta itemprop="pageType" content="<?php echo esc_attr( $page_type ); ?>"/>
    52             <meta itemprop="datePublished" content="<?php the_time('c') ?>"/>
    53             <meta itemprop="dateModified" content="<?php the_modified_date('c') ?>"/>
     52            <meta itemprop="datePublished" content="<?php $date = new DateTime( get_the_time('Y-m-d G:i:s'.get_option('gmt_offset')) ); $date->setTimezone(new DateTimeZone('UTC')); echo $date->format('c'); ?>"/>
     53            <meta itemprop="dateModified" content="<?php $date = new DateTime( get_the_modified_date('Y-m-d G:i:s'.get_option('gmt_offset')) ); $date->setTimezone(new DateTimeZone('UTC')); echo $date->format('c'); ?>"/>
    5454            <meta itemprop="url" content="<?php echo esc_attr( get_permalink() ) ?>"/>
    5555            <meta itemprop="inLanguage" content="<?php echo esc_attr( substr( get_locale(), 0, 2 ) ); ?>"/>
Note: See TracChangeset for help on using the changeset viewer.