You should use the save_post
hook to handle your meta box and set the post_parent field of the post.
An alternative aproch is to look at the page edit page and check what is the name of the “parent page” drop down and use the same for your dropdown instead of the parent_id
you use right now.
Related Posts:
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- How to set parent-child relationship between differents custom post types
- Integrating a custom post type into a page hierarchy
- Nested custom post types with permalinks
- Change custom post type to hierarchical after being registered
- How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only
- Display a list of child posts on parent posts of a custom post type
- Custom Post Type as Page parent
- How to handle a hierarchy with custom post types
- Can I have Post Types under other Post Types in Admin menu?
- set a CPT as parent of a page
- Hierachical Custom post types permalinks not working
- Child pages on hierarchical Custom Post Types 404s
- How can I combine posts of different types in one hierarchy?
- Custom Post Type ‘hierarchical’ Help!
- How to check if last uri segment is a custom post type or taxonomy term?
- Custom permalinks – post type – hierarchical taxonomy’s
- How to show term-specific post list, without posts associated with child terms?
- How to query for posts (in hierarchical custom post type) that have children?
- Getting taxonomy terms used by custom post type
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- wp_list_pages doesn’t work in hierarchical custom post type
- Post type hierarchy
- Detect if 1st, 2nd or 3rd level custom page?
- Hierarchical Custom Post Types or Similar
- Custom post type routing with hierarchy
- Parent / Child formatting in a list of post of a custom post type
- Show hierarchical relationship between to custom post types on admin list
- Custom post type hierarchical permalinks not behaving as expected for parent/child pages
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- How to Combine Two Custom Post Types into Single Permalink Structure
- Custom Posts Hierarchy? (State/City/Restaurant)
- Automatically populate a hierarchical taxonomy from a custom field
- Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
- Remove base slug in permalinks of hierarchical custom post type
- Modifying Custom Post Type after registration (will it affect content?)
- Hierarchical Custom Post Types – Show only parent on tax archive?
- Twenty Fifteen: Adjacent posts by menu_order [duplicate]
- Display custom post type in hierarchical order with get_terms
- Should I use custom taxonomy or custom post type
- How to get the parent of a non-hierarchical custom post type being edited in Gutenberg
- Custom Post Type / Two level deep taxonomy (cat. and subcat.) uri problem (error 404)
- Hierarchical Custom Post Types in Array
- WordPress Custom Post Type Children Template
- Use a hierarchical custom post type for a main blog and subblogs?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- How to set a CPT to have a page as a parent, then rewrite urls accordingly?
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- Need help with permalink rewrites for Custom Post Types with hierarchical relationships
- Rewrites/query for multiple hierarchical custom post types
- A case for Hierarchical Custom Posts
- Custom while loop for hierarchical display of a taxonomy
- Get the taxonomy of a post hierarchically
- Custom Post Types hierarchy and rewrite
- Custom post type / taxonomy rewrite archive page 2 gives 404
- Create more category hierarchical depth for custom post type/taxonomy plugin (widget)
- Hierarchial Custom Post Types/Taxonomies
- Hierarchical permalinks for custom post type and taxonomy
- using wp_update_post for updating custom post type
- Custom post type Permalinks with hierarchical Taxonomies
- Create a permalink structure with custom taxonomies and custom post types gives 404
- Custom Post type & Taxonomy 404
- Is it safe to change a Custom Post Type from “hierarchical:false” to “hierarchical:true”?
- get parent content inside child posts
- page template for custom post type
- Templates for hierarchical custom post type
- Creating a non-hierarchical Taxonomy that behaves like categories
- How to query for posts (hierarchical custom post type) that have children but are NOT top level?
- Migrating Hierarchal Taxonomy Categories Between Post Types
- Ideas on how to organize a project [closed]
- Add search to ‘Parent’ dropdown
- How should I structure complex content hierarchies?
- Query all post types but limit to parents
- List child categories from parent category on custom taxonomy page
- Custom post type hierarchical loop in Homepage
- Does “Custom Post Type” can have page hierarhy option?
- Creating an Events Feed with Sub Pages/Posts for Each Event
- How to set a ‘page’ as parent of a custom post type?
- Permalink with hierarchy of Custom Post Types
- Having hierarchies inside WordPress custom post type
- How to convert hierarchical Pages to hierarchical Custom Post Types? Slugs get a number as if they were duplicates
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Attempting to get number of grandchildren of page in WP_Query loop
- Custom post types & Pages hierarchy – Error 404
- Create a Hierarchical List of Custom Taxonomies AND Posts
- Display posts of a hierarchical custom post type excluding parent posts
- Most efficient way of showing children posts?
- Hierarchical Custom Post Type Walker?
- Display a Custom Post Type within another with hierarchically slug
- Custom Post Hierarchy and users
- Custom Post Type categories at edit post not hierarchical
- How can I add a “fake” parent into the permalink?
- taxonomy term names in custom post type permalink structure
- Custom Post Type Child Pages
- Cross post type parent page added parent page to permalink but give 404
- Hierarchy between post types
- Custom taxonomy archive not showing posts of certain child taxonomies
- Specifying Default Template for Hierarchal Custom Post Type [duplicate]
- Hierarchical Custom Post Types
- How to add a regular page under a custom post type?