-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: get_edit_term_link()
optional taxonomy parameter error
#7070
Fix: get_edit_term_link()
optional taxonomy parameter error
#7070
Conversation
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 Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Debarghya-Banerjee Thank you for the pull request!
It looks great overall. Just a few minor suggestions to polish the test.
Hi @felixarntz , Thanks you for the feedback, I have addressed them and made the necessary changes, assigning you again for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Debarghya-Banerjee Thank you, this looks excellent!
Committed in https://core.trac.wordpress.org/changeset/58807 |
Trac Ticket: Core-61726
Problem
get_edit_term_link()
function currently generates an incorrect URL when the$taxonomy
parameter is omitted. This issue arises because$taxonomy
was made optional. However, the implementation overlooked consistently using$tax->name
to populate the taxonomy query parameter in all scenarios.Solution
get_edit_term_link()
to consistently use$tax->name
instead of$taxonomy
when generating the URL. This ensures that the correct taxonomy name is always included in the URL structure, preventing errors and inconsistencies.Steps to Reproduce
get_edit_term_link( 42 )
where42
is theID
of a term.Changes Made
get_edit_term_link()
to use$tax->name
for populating the taxonomy query parameter.Testing
get_edit_term_link()
with and without the $taxonomy parameter.get_edit_term_link()
when determining the correct taxonomy for generating term edit URLs.