hat niemand ein beispiel? mir löschts gleich - das ist garnicht so easy ausser ich bin mal wieder blind
Beiträge von phatbyte
-
-
das heißt ich kann es nicht mit der walker klasse machen oder? ich muss das von hand machen..
-
das ist mein ausgangsarray:
PHP
Alles anzeigenArray ( [0] => stdClass Object ( [ID] => 2 [post_title] => About [post_parent] => 0 [igallery] => 0 ) [1] => stdClass Object ( [ID] => 3 [post_title] => hallo seite [post_parent] => 4 [igallery] => 0 ) [2] => stdClass Object ( [ID] => 4 [post_title] => I'm a new Page [post_parent] => 2 [igallery] => 0 ) [3] => stdClass Object ( [ID] => 6 [post_title] => Hallo & + @ hihi [post_parent] => 3 [igallery] => 0 ) [4] => stdClass Object ( [ID] => 7 [post_title] => Test [post_parent] => 0 [igallery] => 2122007155921 ) )
ich brauch das array aber eigentlich so:PHP
Alles anzeigenArray ( [0] => stdClass Object ( [ID] => 2 [post_title] => About [post_parent] => 0 [igallery] => 0 ) [2] => stdClass Object ( [ID] => 4 [post_title] => I'm a new Page [post_parent] => 2 [igallery] => 0 [child] => [1] => stdClass Object ( [ID] => 3 [post_title] => hallo seite [post_parent] => 4 [igallery] => 0 [child] => [3] => stdClass Object ( [ID] => 6 [post_title] => Hallo & + @ hihi [post_parent] => 3 [igallery] => 0 ) ) ) [4] => stdClass Object ( [ID] => 7 [post_title] => Test [post_parent] => 0 [igallery] => 2122007155921 ) )
das ganze wird dann als json geparsed. -
Hallo Community!
Ich sollte die Pages mit ihrer verschachtelung als Assoziatives Array haben. Ich habe gesehen es gibt die Walker Klasse die aber nicht wirklich ein Array returned
Hat jemand sowas schonmal gemacht? Oder gibts was wo ich im WP übersehen habe? Wär super wenn mir jemand weiterhelfen könnte. Vielleicht hat ja jemand sogar ein Beispiel?Vielen Dank!