Rmove fields for none private cutomfields when name refers to a single custom field

This commit is contained in:
Hadi Nategh 2017-10-06 16:27:37 +02:00
parent 48291c6016
commit de65d91dc7

View File

@ -170,6 +170,14 @@ class Customfields extends Transformer
{ {
unset($fields[$key]); unset($fields[$key]);
} }
// Rmove fields for none private cutomfields when name refers to a single custom field
$matches = null;
if (($pos=strpos($form_name,self::$prefix)) !== false &&
preg_match($preg = '/'.self::$prefix.'([^\]]+)/',$form_name,$matches) && !isset($fields[$name=$matches[1]]))
{
unset($fields[$key]);
}
} }
// check if name refers to a single custom field --> show only that // check if name refers to a single custom field --> show only that
$matches = null; $matches = null;