Code Duplication    Length = 7-7 lines in 2 locations

Features/CustomTaxonomies/functions.php 1 location

@@ 11-17 (lines=7) @@
8
use Flynt\Utils\Feature;
9
use Flynt\Features\CustomTaxonomies\CustomTaxonomyRegister;
10
11
add_action('init', function () {
12
    $featureOptions = Feature::getOption('flynt-custom-taxonomies', 0);
13
    $dir = isset($featureOptions['dir']) ? $featureOptions['dir'] : null;
14
    $fileName = isset($featureOptions['fileName']) ? $featureOptions['fileName'] : null;
15
16
    CustomTaxonomyRegister::fromDir($dir, $fileName);
17
}, 3); // needs to happen before custom post types get added
18

Features/CustomPostTypes/functions.php 1 location

@@ 16-22 (lines=7) @@
13
 * in order to make sure custom post types are registered before acf fields
14
 * (e.g. for option pages) are added the priority needs to be lower than 5
15
 */
16
add_action('init', function () {
17
    $featureOptions = Feature::getOption('flynt-custom-post-types', 0);
18
    $dir = isset($featureOptions['dir']) ? $featureOptions['dir'] : null;
19
    $fileName = isset($featureOptions['fileName']) ? $featureOptions['fileName'] : null;
20
21
    CustomPostTypeRegister::fromDir($dir, $fileName);
22
}, 4);
23