Opened 21 months ago
Last modified 13 months ago
#18604 new enhancement
New hook for paginate_links() result
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Formatting | Version: | 3.3 |
| Severity: | major | Keywords: | has-patch dev-feedback |
| Cc: | sirzooro |
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 (11)
lightningspirit — 21 months 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.
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.
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.
Oh okay, I think updating to the new style will be better than revamping this one. Should I create a new ticket?
Yeah, you should make a new ticket; the filters might be a good idea on their own.
lightningspirit — 13 months 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.
- 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.

This patch add two new filters at end of paginate_links()