Is there a way to limit the creation of pages (custom post type) to a specific depth - e.g. level 1 (where 0 = parent, 1 = child, 2 = grand-child, etc.)?
For example, let's create a 'Summer' recipe page (custom post type: Recipe) with a slug '/summer'. Let's now create a 'Pie' page (a child of 'Summer') with a slug '/summer/pie'. I want to prevent the user from creating a page which is a child of 'Pie' or of any other sub-page.
- example.com/summer -> GOOD
- example.com/summer/pie -> GOOD
- example.com/summer/pie/apple -> BAD
- example.com/summer/pie/blackberry -> BAD
Thanks.