Ensure we're only auto-adding root pages to menus. fixes #13447.

git-svn-id: https://develop.svn.wordpress.org/trunk@15111 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-06-02 15:08:03 +00:00
parent 00e5134460
commit b94b5ece42
1 changed files with 2 additions and 0 deletions

View File

@ -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;