Carbon Fields – How to check against Post Parent?


I’m looking for a way to check against the Post Parent ID, and see it can be done from the support docs.

However, I can’t seem to get any variation of post_parent_id to work.

/* Service CPT */
Container::make( 'post_meta', __( 'Page Options' ) )
    ->where( 'post_type', '=', 'service' ) // only show our new fields on this post type
    ->where( 'post_parent_id', '>', 0 )
        Field::make( 'rich_text', 'intro_heading', 'Introduction Heading' )
    ] );

I simply trying to check if the parent has a value set. However, I also tried putting in a specific parent ID, but still no luck.

Any ideas?

Dario Zadro 8 months 2021-12-10T22:53:04-05:00 0 Answers 0 views 0

Leave an answer