﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
15312,Bug with remove_meta_box bug with pageparentdiv when saving a page,maorb,,"Hi,

I use some code to remove the meta_box of some boxes in the page edit. I also remove the parent_page select box to users that not have admin capabilities, in order that thet parent page won't be modified.

My code is something like - 

{{{
function tc_remove_menus () {
global $current_user;
if (!current_user_can('administrator')) :
$boxes = array(	 'passworddiv', 'tagsdiv', 'trackbacksdiv', pageparentdiv', commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv', 'postcustom' ); 
	foreach ($boxes as $box){				
		remove_meta_box($box, 'page', 'normal');		
	}
endif;
}
add_action('admin_menu', 'tc_remove_menus');
}}}

The code works well and these meta boxes are removed. But, what happens upon a page update, is that the parent_page value is being reset to zero and thus any child page that is being edited and saved, becomes a parent page and loses its place as child page.

Somehow, I assume that after removing the meta box, the $_POST does contain the current state of the page_parent, and thus it is being updated to 0.

It looks that it's a core bug - since if not sending the page_parent field when saving the post/page - why is this field has to be changed/updated at all from its current value??

Thanks",defect (bug),closed,normal,3.1,Administration,3.0.1,normal,fixed,"pages, meta_box",maor@…
