File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,18 +43,15 @@ function render_block_core_rss( $attributes ) {
4343 }
4444 $ title = "<div class='wp-block-rss__item-title'> {$ title }</div> " ;
4545
46- $ date_markup = '' ;
47- if ( ! empty ( $ attributes ['displayDate ' ] ) ) {
48- $ timestamp = $ item ->get_date ( 'U ' );
46+ $ date = '' ;
47+ if ( $ attributes ['displayDate ' ] ) {
48+ $ date = $ item ->get_date ( 'U ' );
4949
50- if ( $ timestamp ) {
51- $ gmt_offset = get_option ( 'gmt_offset ' );
52- $ timestamp += (int ) ( (float ) $ gmt_offset * HOUR_IN_SECONDS );
53-
54- $ date_markup = sprintf (
50+ if ( $ date ) {
51+ $ date = sprintf (
5552 '<time datetime="%1$s" class="wp-block-rss__item-publish-date">%2$s</time> ' ,
56- esc_attr ( date_i18n ( 'c ' , $ timestamp ) ),
57- esc_html ( date_i18n ( get_option ( 'date_format ' ), $ timestamp ) )
53+ esc_attr ( date_i18n ( 'c ' , $ date ) ),
54+ esc_attr ( date_i18n ( get_option ( 'date_format ' ), $ date ) )
5855 );
5956 }
6057 }
@@ -88,7 +85,7 @@ function render_block_core_rss( $attributes ) {
8885 $ excerpt = '<div class="wp-block-rss__item-excerpt"> ' . esc_html ( $ excerpt ) . '</div> ' ;
8986 }
9087
91- $ list_items .= "<li class='wp-block-rss__item'> {$ title }{$ date_markup }{$ author }{$ excerpt }</li> " ;
88+ $ list_items .= "<li class='wp-block-rss__item'> {$ title }{$ date }{$ author }{$ excerpt }</li> " ;
9289 }
9390
9491 $ classnames = array ();
You can’t perform that action at this time.
0 commit comments