#18604 closed enhancement (wontfix)
New hook for paginate_links() result
Reported by: | lightningspirit | Owned by: | lightningspirit |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 3.3 |
Component: | Formatting | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
I'd like to propose two new hooks to paginate_links() in http://core.trac.wordpress.org/browser/trunk/wp-includes/general-template.php#L1950
This two hooks paginate_links_array and paginate_links_html will allow plugins to add, remove or alter html and links in admin pagination output, including the media uploader.
Background: sites with more than a thousand media objects have 140+ pages in media uploader interface. I had to be able to create a input box to enter page number manually.
Attachments (3)
Change History (13)
#1
@
13 years ago
- Keywords ux-feedback removed
If we're going to add a filter there, it should also pass the parameters that paginate_links() received.
And the 'paginate_links_array' filter should be applied only once, before the switch
statement.
#2
@
13 years ago
Also, your screenshot is puzzling. Since WP 3.1, the pagination in the admin has been revamped, adding an input for the current page, like you mentioned.
#3
@
13 years ago
Oh, you mean the pagination links on the Media Library tab?
We should update them to the new style, which can be seen when going to /wp-admin/edit.php for example.
#4
@
13 years ago
Oh okay, I think updating to the new style will be better than revamping this one. Should I create a new ticket?
#5
@
13 years ago
Yeah, you should make a new ticket; the filters might be a good idea on their own.
@
12 years ago
New hook for paginate_links() "paginate_links_{$context}". Added $context variable for developers to be able to apply filters for paginate_links() in diferent contextes. Added $context = 'media-upload' for paginate_links() argument for developers to be able to hack the pagination result in the wp-admin/media-upload.php aka Media Library.
#7
@
12 years ago
- Keywords dev-feedback added
- Severity changed from normal to major
- Version changed from 3.3 to 3.4
This patch adds a new filter hook in paginate_links() function based on context passed through the argument of the function call.
Provides developers the ability to filter the ouptut/result of paginate_links() on diferent contextes!
I've added the context 'media-upload' in the call of media-upload.php file. This way developers can hack the pagination to, for example, provide a more suitable pagination UI if the Media Library have displayed a lot of pages.
#8
@
12 years ago
- Version changed from 3.4 to 3.3
Version number indicates when the bug was initially introduced/reported.
#9
@
11 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Seems like this is no longer applicable as of 3.5. lightningspirit, if there is still a desire (after all these years) for a filter in paginate_links() generally, feel free to reopen. I will mention though that paginate_links() is a low-level utility function that can be used by any context (paginating a post, or comments, or whatever), and it's possible that it's probably just not a good idea.
This patch add two new filters at end of paginate_links()