Skip to content

fix: include directory slug in author profile links - #2957

Open
syedgalib wants to merge 2 commits into
sovware:developmentfrom
syedgalib:fix/author-profile-link
Open

fix: include directory slug in author profile links#2957
syedgalib wants to merge 2 commits into
sovware:developmentfrom
syedgalib:fix/author-profile-link

Conversation

@syedgalib

@syedgalib syedgalib commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

The author profile link in the Author Info widget did not include the current listing directory type slug, so multi-directory author profile pages could open without the required directory context.

This PR resolves the listing directory type slug from the current listing and passes it to the author profile permalink generator for both the Author Info widget and the single listing Author Info section.

How to Test

  1. Enable multi-directory and open a single listing for a directory type such as business.
  2. Click the View Profile link in the Author Info widget or single listing Author Info section.
  3. Confirm the author profile URL includes the directory type slug, for example /author-profile/admin/directory/business/.

Any linked issues

Fixes #

Checklist

@RabbiIslamRony RabbiIslamRony left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The intended View Profile URLs now receive the listing directory slug, and the new helper works correctly in the tested paths. However, one single-listing author profile entry point remains unfixed.

Directorist_Single_Listing::user_avatar() still calls ATBDP_Permalink::get_user_profile_page_link( $this->author_id ) without passing the listing directory slug. In multi-directory mode, the avatar link therefore resolves to /author-profile/{user}/ instead of /author-profile/{user}/directory/{slug}/. I reproduced this locally with a Business listing.

Please reuse ATBDP_Permalink::get_listing_directory_type_slug( $this->id ) in this method and pass the result to get_user_profile_page_link(), then verify both the profile button and avatar link.

Local functional validation on commit 236c0fa confirmed the intended permalink paths pass; the avatar path above still lacks directory context.

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