Completed
Pull Request — master (#17)
by Dominik
03:47 queued 02:52
created

ACFComposer::registerFieldGroup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace ACFComposer;
4
5
class ACFComposer
6
{
7
    /**
8
     * Registers a local field group in Advanced Custom Fields based on a config array.
9
     *
10
     * Included fields, subfields, etc. can either contain another array defining them, or a string that stands for a WordPress filter. This filter will be applied and its result used as the field, subfield, etc.
11
     *
12
     * @param array $config Configuration array for the local field group.
13
     *
14
     * @return boolean Was the field group added or not.
15
     */
16
    public static function registerFieldGroup($config)
17
    {
18
        $fieldGroup = ResolveConfig::forFieldGroup($config);
19
        return acf_add_local_field_group($fieldGroup);
20
    }
21
}
22