Last active
April 3, 2024 21:12
-
-
Save certainlyakey/9da9bab22cd073ee486d to your computer and use it in GitHub Desktop.
Wordpress - Limit pages nesting depth to 2nd level
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Limit pages nesting depth to 2nd level | |
//caution! by default affects all hierarchical CPTs | |
function limit_pages_nesting($a) { | |
$a['depth'] = 1; | |
return $a; | |
} | |
add_action('page_attributes_dropdown_pages_args','limit_pages_nesting'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does not work in era of Gutenberg: WordPress/gutenberg#9089.