Ticket #5004 (closed enhancement: duplicate)

Opened 10 months ago

Last modified 6 months ago

Allow Setting The Depth On wp_list_categories

Reported by: intoxination Assigned to: anonymous
Priority: normal Milestone:
Component: General Version: 2.3
Severity: normal Keywords: category depth has-patch dev-feedback
Cc:

Description

Attached is a path to add a depth query argument for wp_list_categories. It defaults to 0 which will walk the entire hierarchy. If hierarchical=false then the flat list is given and depth is ignored.

Attachments

categorydepth.diff (0.7 kB) - added by intoxination on 09/19/07 02:46:04.

Change History

09/19/07 02:46:04 changed by intoxination

  • attachment categorydepth.diff added.

09/19/07 02:46:34 changed by intoxination

  • type changed from defect to enhancement.

09/19/07 18:44:19 changed by foolswisdom

  • milestone set to 2.4.

01/10/08 19:56:53 changed by palamedes

It looks like this has been "Mostly" implemented with one minor change.

Change line 292 to;

$depth = $rdepth?; // Walk requested depth (0 being full depth).

This way the user can actually specify the depth they want it to be walked via the argument. Otherwise it was just 0 or -1 which doesn't actually do what this RFE had intended.

(Heres the diff since I'm not sure how you guys want it..)

[palamedes]$ diff category-template.php category-template.php.old 253c253

< 'echo' => 1, 'depth' => 0

---

'echo' => 1

292c292

< $depth = $rdepth?; // Walk requested depth (0 being full depth).

---

$depth = 0; // Walk the full depth.

01/10/08 19:57:26 changed by palamedes

Note: the post got corrupted when I submitted it. I'll attach a file with the diff.

01/10/08 19:59:19 changed by palamedes

Hrmm don't have permission to.. okay lets try this;

diff category-template.php category-template.php.bak 

253c253
<               'echo' => 1, 'depth' => 0
---
>               'echo' => 1

292c292
<                       $depth = $r['depth'];  // Walk requested depth (0 being full depth).
---
>                       $depth = 0;  // Walk the full depth.

01/10/08 20:30:53 changed by pishmishy

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

Duplicates #2461. Patches are pretty much identical too =)

01/10/08 23:57:36 changed by lloydbudd

  • milestone deleted.