My metabox array is setup like this:
$meta_boxes = array(
'id' => 'client',
'title' => __( 'Client Fields', 'vwh' ),
'post_types' => 'client',
'context' => 'normal',
'priority' => 'high',
'autosave' => true,
'exclude' => array('is_child'=>true),
'hide' => array('is_child'=>true),
// List of meta fields
'fields' => array(
The exclude is working, but the hide is not. I tried "input_value" as well but that didn't work either, it is a custom post type.
Are you using both exclude and hide at the same time? If exclude rule is there, then meta box is not outputted in the page and thus, the hide rule doesn't work.
Right, but when it's a new page and it is not yet a child the exclude doesn't take affect.
That's the specific use case. You've created a new post that will become a child so let's remove the fields you don't need.
I see. In this specific case, the new post hasn't been a child yet, so both exclude and hide couldn't detect that. So the rules couldn't work.
I will think more about this specific case between add new post and edit an existing post. This probably is the same as this problem.
But isn't hide supposed to change things when form elements are updated before it's saved? Wouldn't that work here? I also tried the input_value method and it didn't work.
Ah, I see. Probably a bug with the Show/Hide extension. I will fix it to support "live" change.
I've just updated the Show/Hide extension. is_child is working as expected. Please update and check it.