Completed
Pull Request — master (#17)
by Dominik
04:24
created

ACFComposer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerFieldGroup() 0 5 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