I am trying to hide multiple custom fields from my wordpress backend using is_protected_meta()
This code works:
add_filter('is_protected_meta', 'my_is_protected_meta_filter', 10, 2);
function my_is_protected_meta_filter($protected, $meta_key) {
return $meta_key == 'pyre_custom1' ? true : $protected;
}
But it is not working when i am trying to pass multiple values..My code is:
add_filter('is_protected_meta', 'my_is_protected_meta_filter', 10, 2);
function my_is_protected_meta_filter($protected, $meta_key) {
return array($meta_key == 'pyre_custom1' ? true : $protected,$meta_key == 'pyre_custom2' ? true : $protected,$meta_key == 'pyre_custom3' ? true : $protected);
}
This seem to hide the full custom fields section. How can i make it work?