Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#3898 closed defect (bug) (fixed)

wp_list_bookmarks doesn't pass parameters to get_bookmarks

Reported by: otto42's profile Otto42 Owned by: ryan's profile ryan
Milestone: 2.2 Priority: normal
Severity: normal Version: 2.1.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

The wp_list_bookmarks function in 2.1.1 repeats several parameters along to get_bookmarks in a rather unusual manner. In so doing, it fails to pass along potentially useful parameters that would allow the function to expand in scope. This also makes several of the parameters given for the wp_list_bookmarks function in the codex not work.

For example:
wp_list_bookmarks('include=1') should cause just bookmark with ID 1 to be displayed (ignoring categories). However, because the parameter is not passed along to get_bookmarks, include does not work at all. Same for most of get_bookmarks parameters.

The fix is to eliminate the string being passed to get_bookmarks and replace it with the parameter array, as is done in most other functions of this nature. One exception must be made, to pass the correct category when looping through categories. This is done with an array_merge to create a new array with the category overwritten.

Attachments (1)

wp_list_bookmarks_fix.diff (1.2 KB) - added by Otto42 18 years ago.
Patch to correct parameter handling in wp_list_bookmarks

Download all attachments as: .zip

Change History (7)

@Otto42
18 years ago

Patch to correct parameter handling in wp_list_bookmarks

#1 @Otto42
18 years ago

  • Keywords has-patch added

#2 @Otto42
18 years ago

  • Keywords bg|has-patch added; has-patch removed

#3 @Otto42
18 years ago

  • Keywords has-patch added; bg|has-patch removed

Sorry, still learning to use trac. :)

#4 @markjaquith
18 years ago

  • Owner changed from anonymous to ryan

#5 @ryan
18 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4964]) Pass along all parameters to get_bookmarks(). Props Otto42. fixes #3898

#6 @ryan
18 years ago

  • Milestone changed from 2.1.3 to 2.2
Note: See TracTickets for help on using tickets.