Opened 3 years ago
Last modified 20 months ago
#14960 accepted enhancement
Add More bulk actions to the link manager
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | Future Release |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch dev-feedback |
| Cc: |
Description
Currently, the link manager supports only one bulk action, which is delete.
If there are a lot of links, making links visible and invisible is now a tedious process. A bulk action for "make visible" and "make hidden" would be a good enhancement, IMHO.
Attachments (2)
Change History (8)
That said, it's pretty easy for plugins to add additional bulk actions in WP 3.1.
- Keywords has-patch dev-feedback added
- Owner set to edwardw
- Status changed from new to accepted
- Version 3.1 deleted
comment:4
SergeyBiryukov — 22 months ago
- Keywords links link manager removed
- Keywords needs-refresh added; dev-feedback removed
- Priority changed from normal to low
This patch seems like a good first step.
Coding standards:
- Needs more spaces, especially in wp-admin/link.php and in link-manager.php.
- Use single quotes rather than double quotes when able, in the list table code.
- In link-manager.php, convert the $doaction if/elseif/elseif to a switch with breaks.
Code itself:
- Use esc_url( wp_nonce_url( admin_url() ) ), rather than wp_nonce_url() and &. esc_url() will do that conversion for you, and further, wp_nonce_url() will reverse & anyway, so it's ending up unescaped in the existing patch.
- Namespace the nonces. Rather than show_$id, hide_$id, consider show-bookmark_$id and hide-bookmark_$id.
- Only add $actionsshow? if 'N' == $link->link_visible, and only add $actionshide? if Y' == $link->link_visible. (Note this is not a simple if/else construct, but rather if/elseif, as I think a plugin could override link_visible to be another value. So better to be specific that these actions only work for the boolean values.)
Translations:
- Translators will probably want these links to be contextualized. So _x( 'Show', 'link' ), and _x( 'Hide', 'link' ). We don't seem to be very good at contextualizing action links here and elsewhere though, so you can skip this step.
Ultimately, links are such a little-used feature that this patch will never be a priority. But once we branch off 3.3 and trunk becomes 3.4, if someone drops a comment I will come by and handle. (Assuming the patch is updated.)

An even better enhancement would be to transform links into a custom post type.