| @@ -12,9 +12,9 @@ | ||
| 12 | 12 | * |
| 13 | 13 | * @param array $attributes Block attributes. |
| 14 | 14 | * @param string $content Block default content. |
| 15 | 15 | * @param WP_Block $block Block instance. |
| 16 | - * @return string Returns the post link. | |
| 16 | + * @return string Returns the post link. | |
| 17 | 17 | */ |
| 18 | 18 | function gutenberg_render_block_core_read_more( $attributes, $content, $block ) { |
| 19 | 19 | if ( ! isset( $block->context['postId'] ) ) { |
| 20 | 20 | return ''; |
| @@ -37,11 +37,11 @@ | ||
| 37 | 37 | $justify_class_name = empty( $attributes['justifyContent'] ) ? '' : "is-justified-{$attributes['justifyContent']}"; |
| 38 | 38 | $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $justify_class_name ) ); |
| 39 | 39 | $more_text = ! empty( $attributes['content'] ) ? wp_kses_post( $attributes['content'] ) : __( 'Read more' ); |
| 40 | 40 | return sprintf( |
| 41 | - '<a %1s href="%2s" target="%3s">%4s<span class="screen-reader-text">%5s</span></a>', | |
| 41 | + '<a %1$s href="%2$s" target="%3$s">%4$s<span class="screen-reader-text">%5$s</span></a>', | |
| 42 | 42 | $wrapper_attributes, |
| 43 | - get_the_permalink( $post_ID ), | |
| 43 | + esc_url( get_the_permalink( $post_ID ) ), | |
| 44 | 44 | esc_attr( $attributes['linkTarget'] ), |
| 45 | 45 | $more_text, |
| 46 | 46 | $screen_reader_text |
| 47 | 47 | ); |