| @@ -17,22 +17,12 @@ | ||
| 17 | 17 | if ( ! isset( $block->context['postId'] ) ) { |
| 18 | 18 | return ''; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - $post_ID = $block->context['postId']; | |
| 22 | - $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; | |
| 23 | - $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); | |
| 24 | - $formatted_date = get_the_date( isset( $attributes['format'] ) ? $attributes['format'] : '', $post_ID ); | |
| 25 | - if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { | |
| 26 | - $formatted_date = sprintf( '<a href="%1s">%2s</a>', get_the_permalink( $post_ID ), $formatted_date ); | |
| 27 | - } | |
| 28 | - | |
| 29 | - return sprintf( | |
| 30 | - '<div %1$s><time datetime="%2$s">%3$s</time></div>', | |
| 31 | - $wrapper_attributes, | |
| 32 | - esc_attr( get_the_date( 'c', $post_ID ) ), | |
| 33 | - $formatted_date | |
| 34 | - ); | |
| 21 | + return '<time datetime="' | |
| 22 | + . get_the_date( 'c', $block->context['postId'] ) . '">' | |
| 23 | + . get_the_date( isset( $attributes['format'] ) ? $attributes['format'] : '', $block->context['postId'] ) | |
| 24 | + . '</time>'; | |
| 35 | 25 | } |
| 36 | 26 | |
| 37 | 27 | /** |
| 38 | 28 | * Registers the `core/post-date` block on the server. |