Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
StagingFeature
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 initialize
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace NewfoldLabs\WP\Module\Staging;
4
5use NewfoldLabs\WP\ModuleLoader\Container;
6use NewfoldLabs\WP\Module\Staging\Staging;
7use function NewfoldLabs\WP\ModuleLoader\container as getContainer;
8
9/**
10 * Child class for a feature
11 *
12 * Child classes should define a name property as the feature name for all API calls. This name will be used in the registry.
13 * Child class naming convention is {FeatureName}Feature.
14 */
15class StagingFeature extends \NewfoldLabs\WP\Module\Features\Feature {
16    /**
17     * The feature name.
18     *
19     * @var string
20     */
21    protected $name = 'staging';
22
23    /**
24     * The feature value. Defaults to on.
25     *
26     * @var boolean
27     */
28    protected $value = true;
29
30    /**
31     * Initialize staging feature.
32     */
33    public function initialize() {
34        if ( function_exists( 'add_action' ) ) {
35
36            // Register module
37            add_action(
38                'plugins_loaded',
39                function () {
40                    new Staging( getContainer() );
41                }
42            );
43        }
44    }
45}