Skip to content

Credits Shortcode: Remove trailing double slash from profile URLs#645

Closed
huzaifaalmesbah wants to merge 1 commit into
WordPress:trunkfrom
huzaifaalmesbah:fix/credits-shortcode-double-slash
Closed

Credits Shortcode: Remove trailing double slash from profile URLs#645
huzaifaalmesbah wants to merge 1 commit into
WordPress:trunkfrom
huzaifaalmesbah:fix/credits-shortcode-double-slash

Conversation

@huzaifaalmesbah
Copy link
Copy Markdown
Member

Summary

  • The [wpcredits] shortcode was generating profile URLs with a double trailing slash (//), e.g. https://profiles.wordpress.org/username//
  • The profiles URL template in wp-credits.php already includes a trailing slash (%s/), so the extra / appended in shortcode.php was redundant
  • Removed the unnecessary / concatenation from the anchor href output
Huzaifa-20260521231217

Test plan

  • Use the shortcode [wpcredits 7.0 class="has-small-font-size" exclude="ideag"] on a page
  • Verify that profile links now render as https://profiles.wordpress.org/{username}/ (single trailing slash)
  • Verify links still work and redirect correctly to user profiles

The profiles URL template already includes a trailing slash (`%s/`), so appending another `/` in the shortcode resulted in `//` in the href.
Copilot AI review requested due to automatic review settings May 21, 2026 17:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes malformed contributor profile links generated by the [wpcredits] shortcode by removing an extra trailing slash that resulted in // at the end of profile URLs.

Changes:

  • Remove redundant '/’ concatenation when building contributor profile links so the existing %s/ URL template is used as-is.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$output = array();
foreach ( $props as $username => $name ) {
$output[] = '<a href="' . sprintf( $results['data']['profiles'], $username ) . '/">' . $name . '</a>';
$output[] = '<a href="' . sprintf( $results['data']['profiles'], $username ) . '">' . $name . '</a>';
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props huzaifaalmesbah.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@bazza bazza closed this in e95681e May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants