Ticket #3898 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

wp_list_bookmarks doesn't pass parameters to get_bookmarks

Reported by: Otto42 Assigned to: ryan
Priority: normal Milestone: 2.2
Component: General Version: 2.1.1
Severity: normal Keywords: has-patch
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

wp_list_bookmarks_fix.diff (1.2 kB) - added by Otto42 on 03/02/07 01:16:34.
Patch to correct parameter handling in wp_list_bookmarks

Change History

03/02/07 01:16:34 changed by Otto42

  • attachment wp_list_bookmarks_fix.diff added.

Patch to correct parameter handling in wp_list_bookmarks

03/02/07 01:22:32 changed by Otto42

  • keywords set to has-patch.

03/02/07 01:23:41 changed by Otto42

  • keywords changed from has-patch to bg|has-patch.

03/02/07 01:27:19 changed by Otto42

  • keywords changed from bg|has-patch to has-patch.

Sorry, still learning to use trac. :)

03/02/07 07:53:13 changed by markjaquith

  • owner changed from anonymous to ryan.

03/04/07 01:59:59 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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

03/16/07 19:37:12 changed by ryan

  • milestone changed from 2.1.3 to 2.2.