Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Parent / Childrelationship in forum loop


kevinjohngallagher
Member

@kevinjohngallagher

So, the issue with the method implemented in : https://bbpress.org/forums/topic/hiding-subforums-subforums-from-subforum-pages

is that it only checks for the lineage of the forum before it.

This causes problems when you have multiple children to multiple children, as thus:

category

– Forum1

– – Child 1

– – – Child1’s child

– – Child 2

That method will make BBpress think that Child 2 is actually under Child1’s Child, because when testing if their parents are the same they clearly are not.

Instead, we have to create a nesting code that counts the depth to which we go as we trawl through each parent/child relationship – which is daft as there is a walker->depth function that we just don’t have access to via $GLOBALS.

EDIT:

Update – not knowing if it’s the last forum in a category is starting to kill me a little.

Skip to toolbar