Skip to content

Commit

Permalink
Add trailing slash to profile URL (#356)
Browse files Browse the repository at this point in the history
Uses sprintf for readability.
  • Loading branch information
ironprogrammer authored Nov 29, 2023
1 parent 38e9e28 commit e10e2b5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function render( $attributes, $content, $block ) {
$block_content .= '<!-- wp:heading {"textAlign":"center","style":{"spacing":{"margin":{"top":"var:preset|spacing|40","right":"var:preset|spacing|default","bottom":"var:preset|spacing|40","left":"var:preset|spacing|default"}}},"fontSize":"extra-large"} -->';
$block_content .= '<h2 class="wp-block-heading has-text-align-center has-extra-large-font-size" style="margin-top:var(--wp--preset--spacing--40);margin-right:var(--wp--preset--spacing--default);margin-bottom:var(--wp--preset--spacing--40);margin-left:var(--wp--preset--spacing--default)">';
$block_content .= '<em>';
$block_content .= '<a href="' . esc_url( 'https://profiles.wordpress.org/' . $profile->user_nicename ) . '">' . esc_html( $profile->display_name ) . '</a>';
$block_content .= '<a href="' . esc_url( sprintf( 'https://profiles.wordpress.org/%s/', $profile->user_nicename ) ) . '">' . esc_html( $profile->display_name ) . '</a>';
$block_content .= '</em>';
$block_content .= '</h2>';
$block_content .= '<!-- /wp:heading -->';
Expand Down

0 comments on commit e10e2b5

Please sign in to comment.