lightspeeddevelopment /
lsx-health-plan
| 1 | <?php |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 2 | namespace lsx_health_plan\classes; |
||
| 3 | |||
| 4 | /** |
||
| 5 | * Contains the downloads functions post type |
||
| 6 | * |
||
| 7 | * @package lsx-health-plan |
||
| 8 | */ |
||
| 9 | class FacetWP { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Holds class instance |
||
| 13 | * |
||
| 14 | * @var object \lsx_health_plan\classes\FacetWP() |
||
| 15 | */ |
||
| 16 | protected static $instance = null; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Holds the indexer filters for the workouts. |
||
| 20 | * |
||
| 21 | * @var object \lsx_health_plan\classes\integrations\FacetWP\Workouts_Indexer() |
||
| 22 | */ |
||
| 23 | public $workouts = null; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Constructor |
||
| 27 | */ |
||
| 28 | public function __construct() { |
||
|
0 ignored issues
–
show
|
|||
| 29 | $this->load_classes(); |
||
| 30 | add_filter( 'facetwp_facet_sources', array( $this, 'register_sources' ) ); |
||
| 31 | } |
||
|
0 ignored issues
–
show
|
|||
| 32 | |||
| 33 | /** |
||
| 34 | * Return an instance of this class. |
||
| 35 | * |
||
| 36 | * @since 1.0.0 |
||
| 37 | * |
||
| 38 | * @return object \lsx_health_plan\classes\FacetWP() A single instance of this class. |
||
| 39 | */ |
||
| 40 | public static function get_instance() { |
||
| 41 | // If the single instance hasn't been set, set it now. |
||
| 42 | if ( null === self::$instance ) { |
||
|
0 ignored issues
–
show
|
|||
| 43 | self::$instance = new self(); |
||
| 44 | } |
||
|
0 ignored issues
–
show
|
|||
| 45 | return self::$instance; |
||
| 46 | } |
||
|
0 ignored issues
–
show
|
|||
| 47 | |||
| 48 | /** |
||
| 49 | * Loads the variable classes and the static classes. |
||
| 50 | */ |
||
| 51 | private function load_classes() { |
||
| 52 | require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/facetwp/class-connected-plans.php'; |
||
| 53 | $this->connected_plans = integrations\facetwp\Connected_Plans::get_instance(); |
||
|
0 ignored issues
–
show
|
|||
| 54 | } |
||
|
0 ignored issues
–
show
|
|||
| 55 | |||
| 56 | /** |
||
| 57 | * Registers the custom sources. |
||
| 58 | * |
||
| 59 | * @param array $sources |
||
|
0 ignored issues
–
show
|
|||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | public function register_sources( $sources ) { |
||
| 63 | $sources['lsx_health_plan'] = array( |
||
| 64 | 'label' => __( 'LSX Health Plan', 'lsx-health-plan' ), |
||
| 65 | 'choices' => array( |
||
| 66 | 'lsx_hp/connected_plans' => 'Connected Plans', |
||
| 67 | ), |
||
| 68 | ); |
||
| 69 | |||
| 70 | return $sources; |
||
| 71 | } |
||
|
0 ignored issues
–
show
|
|||
| 72 | } |
||
| 73 |