Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
1
vote
2
answers
516
views
How to target a specific custom post type post and its all children and grandchildren?
// call the same function again for grandchildren
$gchildren = get_posts_children($CPT, $child->ID);
// merge the grand children into the children array
if( ! … empty($gchildren) ) {
$children = array_merge($children, $gchildren);
}
}
// merge in the direct descendants we found earlier
$children = array_merge …
0
votes
Accepted
How to target a specific custom post type post and its all children and grandchildren?
(you can remove it if you only need the children and grandchildren of a given post ID or slug).
// grab the direct children of the post by given $post_slug or post ID. … //But allowing them to access second_page and its children for that matter.
} …