Opened 8 years ago
Closed 8 months ago
#44269 closed defect (bug) (wontfix)
Add optional parameter $merge_args into paginate_links function
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.1 |
| Component: | General | Keywords: | reporter-feedback close |
| Focuses: | Cc: |
Description
I'm passing a query arg that exists on args in current url, but the value passed by parameter is different. What happens is that the value of query arg passed as tabname is overwritten by value into current url arg.
I suggest an optional parameter called $merge_args and default value as true, in this way, all necessary query args to build pagination links should be passed by add_args and nothing is overwrite.
<?php function paginate_links( $args = '', $merge_args = true ) { ... ... if ( isset( $url_parts[1] ) ) { ... ... if($merge_args) { $args['add_args'] = array_merge( $args['add_args'], urlencode_deep( $url_query_args ) ); } } }
Attachments (1)
Change History (5)
This ticket was mentioned in Slack in #core by noisysocks. View the logs.
5 years ago
#2
@
5 years ago
- Keywords reporter-feedback added
- Version changed from 4.9.5 to 2.1
@andrepoandrade Hello, and a belated welcome to trac!
This was discussed in a triage session today.
Are you able to provide a little more details about the use case you have in mind? It might be helpful to include some sample URLs to demonstrate how you'd like the new argument to affect them.
Thanks.
#4
@
8 months ago
- Keywords close added
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Thank you for reporting this, for now I am going to move this to close for a number of reasons:
- A significant amount of time has passed without feedback.
- In triage a few years ago it was identified that feedback was needed for this use case.
With that in mind it is hard to discover if this would be useful. For now adding won't fix over any other label as it could be something with further information we change. With that in mind, we can always reopen tickets so if there are more details please add them for review. Thank you again.
File general-template.php with modified paginate_links function