Opened 18 years ago
Closed 17 years ago
#3595 closed enhancement (fixed)
Links and link categories not filtered by get_links_list
Reported by: | jhodgdon | Owned by: | rob1n |
---|---|---|---|
Milestone: | 2.3 | Priority: | high |
Severity: | normal | Version: | 2.0.7 |
Component: | General | Keywords: | link, filter, has-patch |
Focuses: | Cc: |
Description
When you make a list of links (or blogroll) in your sidebar using the get_links_list function, neither the link category names nor the links themselves are run through a filter. It would be very helpful if they were filtered, so that plugins could modify the text displayed.
For instance, the Polyglot plugin filters regular category names, so you can make them bilingual. But link names and link categories are not filtered in the same way.
I suggest creating filters called: link_category, link_title, link_description
I will attach some patches to implement this...
Attachments (8)
Change History (27)
#2
@
18 years ago
- Owner set to jhodgdon
See ticket [3599 #3599] for some additional information on the admin section's filtering of links.
#5
@
18 years ago
Ryan: send me email if you would like me to patch anything else... I am done with the patches I knew about needing, for the moment.
#8
@
18 years ago
- Cc jhodgdon added
I just found another spot in bookmark-template.php that also needed patching in a similar way, for the wp_list_bookmarks function. Since this is still open, I'll just attach that patch here...
#9
@
18 years ago
Ryan, I just realized your earlier comment about _walk_bookmarks is why wp_list_bookmarks was not working. Sorry about missing the earlier comment -- anyway this latest patch fixes _walk_bookmarks.
#11
@
17 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
I am reopening this bug because the first patch above to bookmarks-template.php didn't ever get applied. Could it be? Thanks!
Verified it is not applied in [5560]; also not applied in 2.2.
#14
@
17 years ago
I just added a new patch, which works on [5744], called bookmark-template-php-NEW.diff.
Don't apply it to the 2.2 branch, of course! For that branch, the patch above called "bookmark-template.php.diff" would be better.
#15
@
17 years ago
I have a new patch that uses the sanitize_bookmark function instead of directly using apply_filters, as requested by rboren during the bug hunt. Attaching momentarily...
#16
@
17 years ago
In [6002], the admin screens are now fine, but the sidebar function get_links_list is still broken. The bookmark-template-php-2-3.diff patch (above) fixes that.
A related problem that was patched above is that if you visit (blogurl)/wp-links-opml.php (to make an OPML dump of your blogroll), the title element is unfiltered (this is the blog title). The patch that was there for wp-links-opml.php is not updated for the new functions in 2.3, so I'll make a new one.
The other patch that was there for the link import screen is not needed, as that problem was fixed in another patch.
#17
@
17 years ago
So I suggest applying just these two patches:
bookmark-template-php-2-3.diff
wp-links-opml-2-3.diff
By the way, where does that $cat_name in wp-links-opml.php come from (right after get_bloginfo('name') in the patched line? It should probably be omitted? I tried visiting
(blogurl)/wp-links-opml.php?cat=1
(which is my default link category) and it didn't put anything in the output for $cat_name, so I think it's never being defined. Not sure what it was intended to do -- maybe it was from a previous version and didn't get deleted? If it is intended to print a category name, then probably it should be fixed so it actually does.
Patch of wp-includes/bookmark-template.php to implement link and link category filtering