public function replaceMetaBoxGroupMatches($meta_boxes)
    {
        if (!Arr::iterable($meta_boxes)) {
            return $meta_boxes;
        }

        foreach ($meta_boxes as $k => $group) {
            $group = (is_array($group)) ? $group : array($group);
            if (array_key_exists('fields', $group)) {
                continue;
            }

            $fields = $this->getFields();

            $new_group = array();
            foreach ($group as $pattern_key => $pattern) {
                if (!preg_match('/\*$/', $pattern)) {
                    $new_group[] = $pattern;
                    continue;
                }

                $prefix = preg_replace('/\*$/', '', $pattern);
                $regex = sprintf('/^%s/', $prefix);
                foreach ($fields as $field_key => $field) {
                    if (!preg_match($regex, $field_key)) {
                        continue;
                    }

                    $new_group[] = $field_key;
                }
            }
            $meta_boxes[$k] = $new_group;
        }

        return $meta_boxes;
    }
public function replaceMetaBoxGroupMatches($meta_boxes)
    {
        if (!Arr::iterable($meta_boxes)) {
            return $meta_boxes;
        }

        foreach ($meta_boxes as $k => $group) {
            $group = (is_array($group)) ? $group : array($group);
            if (array_key_exists('fields', $group)) {
                continue;
            }

            $fields = $this->getFields();

            $new_group = array();
            foreach ($group as $pattern_key => $pattern) {
                if (!preg_match('/\*$/', $pattern)) {
                    $new_group[] = $pattern;
                    continue;
                }

                $prefix = preg_replace('/\*$/', '', $pattern);
                $regex = sprintf('/^%s/', $prefix);
                foreach ($fields as $field_key => $field) {
                    if (!preg_match($regex, $field_key)) {
                        continue;
                    }

                    $new_group[] = $field_key;
                }
            }
            $meta_boxes[$k] = $new_group;
        }

        return $meta_boxes;
    }
public function replaceMetaBoxGroupMatches ( $ meta_boxes ) { if ( ! Arr :: iterable ( $ meta_boxes ) ) { return $ meta_boxes ; } foreach ( $ meta_boxes as $ k => $ group ) { $ group = ( is_array ( $ group ) ) ? $ group : array ( $ group ) ; if ( array_key_exists ( 'fields' , $ group ) ) { continue ; } $ fields = $ this -> getFields ( ) ; $ new_group = array ( ) ; foreach ( $ group as $ pattern_key => $ pattern ) { if ( ! preg_match ( '/\*$/' , $ pattern ) ) { $ new_group [ ] = $ pattern ; continue ; } $ prefix = preg_replace ( '/\*$/' , '' , $ pattern ) ; $ regex = sprintf ( '/^%s/' , $ prefix ) ; foreach ( $ fields as $ field_key => $ field ) { if ( ! preg_match ( $ regex , $ field_key ) ) { continue ; } $ new_group [ ] = $ field_key ; } } $ meta_boxes [ $ k ] = $ new_group ; } return $ meta_boxes ; }
Replace any meta box group matches
@param array $meta_boxes
@return array
Replace any meta box group matches