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:
nacin 2010-06-02 15:08:03 +00:00
parent 23ad4b4ef0
commit a161f9bdcd

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;