How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only

function my_test($a) {
  $a['depth'] = 1;
  return $a;
}
add_action('page_attributes_dropdown_pages_args','my_test');

Put that in a theme’s function.php or in a plugin.

Leave a Comment