mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Ensure we're only auto-adding root pages to menus. fixes #13447.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
23ad4b4ef0
commit
a161f9bdcd
@ -748,6 +748,8 @@ function _wp_delete_tax_menu_item( $object_id = 0 ) {
|
||||
function _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) {
|
||||
if ( 'publish' != $new_status || 'publish' == $old_status || 'page' != $post->post_type )
|
||||
return;
|
||||
if ( ! empty( $post->post_parent ) )
|
||||
return;
|
||||
$auto_add = get_option( 'nav_menu_options' );
|
||||
if ( empty( $auto_add ) || ! is_array( $auto_add ) || ! isset( $auto_add['auto_add'] ) )
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user