[Plugin: Types – Custom Fields and Custom Post Types Management] Child pages of custom post type not
-
I set up a custom post type of Event. In that post type, I specified that Pages could be a child of Event, since I did have a Page that I wanted to associate with that Event (and only Page per Event).
On my Page edit screen, I was able to properly select the Event that I wanted to be the parent. And also on my Event page I can see that the child page is properly filled in the “Fields” area (where other children of the Event post are).
However, now I’m trying to access these in a plugin I’ve written. I have my post ID for my event, and I’m trying to get the children of that Event like so:
$params = array( 'post_parent' => 16, 'post_type' => 'page' ); $survey_page = get_children($params);
This always returns empty. And if I check in the database, I see that for my child post, there isn’t anything the post_parent field.
So how are these relationships getting stored and is there a different function I should be calling to get the children of a custom post type?
- The topic ‘[Plugin: Types – Custom Fields and Custom Post Types Management] Child pages of custom post type not’ is closed to new replies.