WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#3898 closed defect (bug) (fixed)

wp_list_bookmarks doesn't pass parameters to get_bookmarks

Reported by: Otto42 Owned by: 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 7 years ago.
Patch to correct parameter handling in wp_list_bookmarks

Download all attachments as: .zip

Change History (7)

Otto427 years ago

Patch to correct parameter handling in wp_list_bookmarks

comment:1 Otto427 years ago

  • Keywords has-patch added

comment:2 Otto427 years ago

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

comment:3 Otto427 years ago

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

Sorry, still learning to use trac. :)

comment:4 markjaquith7 years ago

  • Owner changed from anonymous to ryan

comment:5 ryan7 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

comment:6 ryan7 years ago

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