@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $tab_experience['content'] = get_post_meta( get_the_ID(), 'team_member_experience', true ); |
8 | 8 | $tab_experience['shortcode'] = ''; |
9 | 9 | if ( ! empty( $tab_experience['content'] ) ) { |
10 | - $tabs[] = $tab_experience; |
|
10 | + $tabs[] = $tab_experience; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | // Tab Featured plan |
@@ -18,77 +18,77 @@ discard block |
||
18 | 18 | |
19 | 19 | if ( ! empty( $tab_plans['posts'] ) ) { |
20 | 20 | |
21 | - $plan_content = ''; |
|
21 | + $plan_content = ''; |
|
22 | 22 | |
23 | - $include = implode( ',', $tab_plans['posts'] ); |
|
24 | - $args = array( |
|
25 | - 'orderby' => 'menu_order', |
|
26 | - 'order' => 'ASC', |
|
27 | - 'post_type' => 'plan', |
|
28 | - 'post__in' => $tab_plans['posts'], |
|
29 | - ); |
|
30 | - //$the_query = new WP_Query( $args ); |
|
23 | + $include = implode( ',', $tab_plans['posts'] ); |
|
24 | + $args = array( |
|
25 | + 'orderby' => 'menu_order', |
|
26 | + 'order' => 'ASC', |
|
27 | + 'post_type' => 'plan', |
|
28 | + 'post__in' => $tab_plans['posts'], |
|
29 | + ); |
|
30 | + //$the_query = new WP_Query( $args ); |
|
31 | 31 | |
32 | - $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"> |
|
32 | + $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"> |
|
33 | 33 | <div class="row">'; |
34 | 34 | |
35 | - foreach ( $tab_plans['posts'] as $index => $post ) { |
|
36 | - |
|
37 | - do_action( 'lsx_entry_before' ); |
|
38 | - |
|
39 | - $plan_content .= '<div class="col-xs-12 col-sm-6 col-md-4">'; |
|
40 | - $plan_content .= '<article class="lsx-slot lsx-hp-shadow">'; |
|
41 | - $plan_content .= '<div class="plan-feature-img">'; |
|
42 | - $plan_content .= '<a href="' . get_permalink( $post ) . '">'; |
|
43 | - |
|
44 | - $linked_product = false; |
|
45 | - $restricted = false; |
|
46 | - $product = null; |
|
47 | - if ( \lsx_health_plan\functions\woocommerce\plan_has_products( $post ) ) { |
|
48 | - $products = \lsx_health_plan\functions\woocommerce\get_plan_products( $post ); |
|
49 | - $linked_product = wc_get_product( $products[0] ); |
|
50 | - $product = $linked_product; |
|
51 | - } |
|
52 | - if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) { |
|
53 | - $restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() ); |
|
54 | - } |
|
55 | - |
|
56 | - $featured_image = get_the_post_thumbnail( $post ); |
|
57 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
58 | - $plan_content .= $featured_image; |
|
59 | - } else { |
|
60 | - $plan_content .= '<img loading="lazy" class="placeholder" src="' . plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' . '">'; |
|
61 | - } |
|
62 | - $plan_content .= '</a>'; |
|
63 | - $plan_content .= '</div>'; |
|
64 | - |
|
65 | - $plan_content .= '<div class="content-box plan-content-box">'; |
|
66 | - $plan_content .= '<h3 class="plan"><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . '</a></h3>'; |
|
67 | - |
|
68 | - if ( false !== $linked_product && false !== $restricted ) { |
|
69 | - $plan_content .= $linked_product->get_price_html(); |
|
70 | - } |
|
71 | - |
|
72 | - $plan_content .= '<div class="excerpt">'; |
|
73 | - if ( ! has_excerpt( $post ) ) { |
|
74 | - $content = wp_trim_words( get_the_content( $post ), 20 ); |
|
75 | - $plan_content .= '<p>' . $content . '</p>'; |
|
76 | - } else { |
|
77 | - $plan_content .= apply_filters( 'the_excerpt', get_the_excerpt( $post ) ); |
|
78 | - } |
|
79 | - $plan_content .= '</div>'; |
|
80 | - |
|
81 | - $plan_content .= '</div>'; |
|
82 | - $plan_content .= '</article>'; |
|
83 | - $plan_content .= '</div>'; |
|
84 | - |
|
85 | - } |
|
86 | - $plan_content .= '</div></div>'; |
|
87 | - |
|
88 | - $tab_plans['content'] = $plan_content; |
|
35 | + foreach ( $tab_plans['posts'] as $index => $post ) { |
|
36 | + |
|
37 | + do_action( 'lsx_entry_before' ); |
|
38 | + |
|
39 | + $plan_content .= '<div class="col-xs-12 col-sm-6 col-md-4">'; |
|
40 | + $plan_content .= '<article class="lsx-slot lsx-hp-shadow">'; |
|
41 | + $plan_content .= '<div class="plan-feature-img">'; |
|
42 | + $plan_content .= '<a href="' . get_permalink( $post ) . '">'; |
|
43 | + |
|
44 | + $linked_product = false; |
|
45 | + $restricted = false; |
|
46 | + $product = null; |
|
47 | + if ( \lsx_health_plan\functions\woocommerce\plan_has_products( $post ) ) { |
|
48 | + $products = \lsx_health_plan\functions\woocommerce\get_plan_products( $post ); |
|
49 | + $linked_product = wc_get_product( $products[0] ); |
|
50 | + $product = $linked_product; |
|
51 | + } |
|
52 | + if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) { |
|
53 | + $restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() ); |
|
54 | + } |
|
55 | + |
|
56 | + $featured_image = get_the_post_thumbnail( $post ); |
|
57 | + if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
58 | + $plan_content .= $featured_image; |
|
59 | + } else { |
|
60 | + $plan_content .= '<img loading="lazy" class="placeholder" src="' . plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' . '">'; |
|
61 | + } |
|
62 | + $plan_content .= '</a>'; |
|
63 | + $plan_content .= '</div>'; |
|
64 | + |
|
65 | + $plan_content .= '<div class="content-box plan-content-box">'; |
|
66 | + $plan_content .= '<h3 class="plan"><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . '</a></h3>'; |
|
67 | + |
|
68 | + if ( false !== $linked_product && false !== $restricted ) { |
|
69 | + $plan_content .= $linked_product->get_price_html(); |
|
70 | + } |
|
71 | + |
|
72 | + $plan_content .= '<div class="excerpt">'; |
|
73 | + if ( ! has_excerpt( $post ) ) { |
|
74 | + $content = wp_trim_words( get_the_content( $post ), 20 ); |
|
75 | + $plan_content .= '<p>' . $content . '</p>'; |
|
76 | + } else { |
|
77 | + $plan_content .= apply_filters( 'the_excerpt', get_the_excerpt( $post ) ); |
|
78 | + } |
|
79 | + $plan_content .= '</div>'; |
|
80 | + |
|
81 | + $plan_content .= '</div>'; |
|
82 | + $plan_content .= '</article>'; |
|
83 | + $plan_content .= '</div>'; |
|
84 | + |
|
85 | + } |
|
86 | + $plan_content .= '</div></div>'; |
|
87 | + |
|
88 | + $tab_plans['content'] = $plan_content; |
|
89 | 89 | } |
90 | 90 | if ( ! empty( $tab_plans['content'] ) ) { |
91 | - $tabs[] = $tab_plans; |
|
91 | + $tabs[] = $tab_plans; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | $tab_testimonial['content'] = ''; |
100 | 100 | |
101 | 101 | if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) { |
102 | - if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
103 | - $columns = count( $tab_testimonial['posts'] ); |
|
104 | - } else { |
|
105 | - $columns = 3; |
|
106 | - } |
|
107 | - |
|
108 | - $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
109 | - $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
|
110 | - $tabs[] = $tab_testimonial; |
|
102 | + if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
103 | + $columns = count( $tab_testimonial['posts'] ); |
|
104 | + } else { |
|
105 | + $columns = 3; |
|
106 | + } |
|
107 | + |
|
108 | + $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
109 | + $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
|
110 | + $tabs[] = $tab_testimonial; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | if ( count( $tabs ) > 0 ) : ?> |
@@ -8,98 +8,98 @@ |
||
8 | 8 | */ |
9 | 9 | class Plan_Query { |
10 | 10 | |
11 | - /** |
|
12 | - * Holds class instance |
|
13 | - * |
|
14 | - * @since 1.0.0 |
|
15 | - * |
|
16 | - * @var object \lsx_health_plan\classes\frontend\Plan_Query() |
|
17 | - */ |
|
18 | - protected static $instance = null; |
|
11 | + /** |
|
12 | + * Holds class instance |
|
13 | + * |
|
14 | + * @since 1.0.0 |
|
15 | + * |
|
16 | + * @var object \lsx_health_plan\classes\frontend\Plan_Query() |
|
17 | + */ |
|
18 | + protected static $instance = null; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Holds the sections for the current plan. |
|
22 | - * |
|
23 | - * @var array |
|
24 | - */ |
|
25 | - public $sections = array(); |
|
20 | + /** |
|
21 | + * Holds the sections for the current plan. |
|
22 | + * |
|
23 | + * @var array |
|
24 | + */ |
|
25 | + public $sections = array(); |
|
26 | 26 | |
27 | - /** |
|
28 | - * Holds the variable true/false if the current plan has sections or not. |
|
29 | - * |
|
30 | - * @var array |
|
31 | - */ |
|
32 | - public $has_sections = false; |
|
27 | + /** |
|
28 | + * Holds the variable true/false if the current plan has sections or not. |
|
29 | + * |
|
30 | + * @var array |
|
31 | + */ |
|
32 | + public $has_sections = false; |
|
33 | 33 | |
34 | - /** |
|
35 | - * Constructor |
|
36 | - */ |
|
37 | - public function __construct() { |
|
38 | - } |
|
34 | + /** |
|
35 | + * Constructor |
|
36 | + */ |
|
37 | + public function __construct() { |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * Return an instance of this class. |
|
42 | - * |
|
43 | - * @since 1.0.0 |
|
44 | - * |
|
45 | - * @return object \lsx_health_plan\classes\frontend\Plan_Query() A single instance of this class. |
|
46 | - */ |
|
47 | - public static function get_instance() { |
|
48 | - // If the single instance hasn't been set, set it now. |
|
49 | - if ( null === self::$instance ) { |
|
50 | - self::$instance = new self(); |
|
51 | - } |
|
52 | - return self::$instance; |
|
53 | - } |
|
40 | + /** |
|
41 | + * Return an instance of this class. |
|
42 | + * |
|
43 | + * @since 1.0.0 |
|
44 | + * |
|
45 | + * @return object \lsx_health_plan\classes\frontend\Plan_Query() A single instance of this class. |
|
46 | + */ |
|
47 | + public static function get_instance() { |
|
48 | + // If the single instance hasn't been set, set it now. |
|
49 | + if ( null === self::$instance ) { |
|
50 | + self::$instance = new self(); |
|
51 | + } |
|
52 | + return self::$instance; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * Undocumented function |
|
57 | - * |
|
58 | - * @return void |
|
59 | - */ |
|
60 | - public function query_sections( $plan_id = '' ) { |
|
61 | - if ( '' === $plan_id ) { |
|
62 | - $plan_id = get_the_ID(); |
|
63 | - } |
|
55 | + /** |
|
56 | + * Undocumented function |
|
57 | + * |
|
58 | + * @return void |
|
59 | + */ |
|
60 | + public function query_sections( $plan_id = '' ) { |
|
61 | + if ( '' === $plan_id ) { |
|
62 | + $plan_id = get_the_ID(); |
|
63 | + } |
|
64 | 64 | |
65 | - $section_array = get_post_meta( $plan_id, 'plan_sections', true ); |
|
66 | - if ( ! empty( $section_array ) ) { |
|
67 | - $this->has_sections = true; |
|
68 | - $this->sections = $section_array; |
|
69 | - } |
|
70 | - return $this->has_sections; |
|
71 | - } |
|
65 | + $section_array = get_post_meta( $plan_id, 'plan_sections', true ); |
|
66 | + if ( ! empty( $section_array ) ) { |
|
67 | + $this->has_sections = true; |
|
68 | + $this->sections = $section_array; |
|
69 | + } |
|
70 | + return $this->has_sections; |
|
71 | + } |
|
72 | 72 | |
73 | - public function get_sections( $group = false ) { |
|
74 | - $sections = $this->sections; |
|
75 | - if ( false !== $group ) { |
|
76 | - $sections = $this->group_sections( $sections ); |
|
77 | - } |
|
78 | - return $sections; |
|
79 | - } |
|
73 | + public function get_sections( $group = false ) { |
|
74 | + $sections = $this->sections; |
|
75 | + if ( false !== $group ) { |
|
76 | + $sections = $this->group_sections( $sections ); |
|
77 | + } |
|
78 | + return $sections; |
|
79 | + } |
|
80 | 80 | |
81 | - public function get_section_count() { |
|
82 | - return count( $this->sections ); |
|
83 | - } |
|
81 | + public function get_section_count() { |
|
82 | + return count( $this->sections ); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * This will group the sections by their "Group" field. |
|
87 | - * |
|
88 | - * @param array $sections |
|
89 | - * @return array |
|
90 | - */ |
|
91 | - public function group_sections( $sections = array() ) { |
|
92 | - $groups = array(); |
|
93 | - if ( ! empty( $sections ) ) { |
|
94 | - foreach ( $sections as $section_key => $section_values ) { |
|
95 | - $group_key = apply_filters( 'lsx_hp_default_plan_group', __( 'Daily Plan', 'lsx-health-plan' ) ); |
|
96 | - if ( isset( $section_values['group'] ) && '' !== $section_values['group'] ) { |
|
97 | - $group_key = $section_values['group']; |
|
98 | - } |
|
99 | - $group_key = sanitize_title( $group_key ); |
|
100 | - $groups[ $group_key ][ $section_key ] = $section_values; |
|
101 | - } |
|
102 | - } |
|
103 | - return $groups; |
|
104 | - } |
|
85 | + /** |
|
86 | + * This will group the sections by their "Group" field. |
|
87 | + * |
|
88 | + * @param array $sections |
|
89 | + * @return array |
|
90 | + */ |
|
91 | + public function group_sections( $sections = array() ) { |
|
92 | + $groups = array(); |
|
93 | + if ( ! empty( $sections ) ) { |
|
94 | + foreach ( $sections as $section_key => $section_values ) { |
|
95 | + $group_key = apply_filters( 'lsx_hp_default_plan_group', __( 'Daily Plan', 'lsx-health-plan' ) ); |
|
96 | + if ( isset( $section_values['group'] ) && '' !== $section_values['group'] ) { |
|
97 | + $group_key = $section_values['group']; |
|
98 | + } |
|
99 | + $group_key = sanitize_title( $group_key ); |
|
100 | + $groups[ $group_key ][ $section_key ] = $section_values; |
|
101 | + } |
|
102 | + } |
|
103 | + return $groups; |
|
104 | + } |
|
105 | 105 | } |
@@ -8,141 +8,141 @@ |
||
8 | 8 | */ |
9 | 9 | class LSX_Team { |
10 | 10 | |
11 | - /** |
|
12 | - * Holds class instance |
|
13 | - * |
|
14 | - * @var object \lsx_health_plan\classes\LSX_Team() |
|
15 | - */ |
|
16 | - protected static $instance = null; |
|
11 | + /** |
|
12 | + * Holds class instance |
|
13 | + * |
|
14 | + * @var object \lsx_health_plan\classes\LSX_Team() |
|
15 | + */ |
|
16 | + protected static $instance = null; |
|
17 | 17 | |
18 | - /** |
|
19 | - * Constructor. |
|
20 | - */ |
|
21 | - public function __construct() { |
|
22 | - $this->default_types = array( |
|
23 | - \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ), |
|
24 | - \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
25 | - \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ), |
|
26 | - \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ), |
|
27 | - \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ), |
|
28 | - ); |
|
29 | - add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 ); |
|
30 | - add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) ); |
|
31 | - add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) ); |
|
32 | - add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) ); |
|
33 | - } |
|
18 | + /** |
|
19 | + * Constructor. |
|
20 | + */ |
|
21 | + public function __construct() { |
|
22 | + $this->default_types = array( |
|
23 | + \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ), |
|
24 | + \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
25 | + \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ), |
|
26 | + \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ), |
|
27 | + \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ), |
|
28 | + ); |
|
29 | + add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 ); |
|
30 | + add_action( 'cmb2_admin_init', array( $this, 'related_team_metabox' ) ); |
|
31 | + add_action( 'cmb2_admin_init', array( $this, 'additional_single_team_metabox' ) ); |
|
32 | + add_action( 'lsx_entry_bottom', array( $this, 'hp_team_member_tabs' ) ); |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * Return an instance of this class. |
|
37 | - * |
|
38 | - * @since 1.0.0 |
|
39 | - * |
|
40 | - * @return object \lsx_health_plan\classes\LSX_Team() A single instance of this class. |
|
41 | - */ |
|
42 | - public static function get_instance() { |
|
43 | - // If the single instance hasn't been set, set it now. |
|
44 | - if ( null === self::$instance ) { |
|
45 | - self::$instance = new self(); |
|
46 | - } |
|
47 | - return self::$instance; |
|
48 | - } |
|
35 | + /** |
|
36 | + * Return an instance of this class. |
|
37 | + * |
|
38 | + * @since 1.0.0 |
|
39 | + * |
|
40 | + * @return object \lsx_health_plan\classes\LSX_Team() A single instance of this class. |
|
41 | + */ |
|
42 | + public static function get_instance() { |
|
43 | + // If the single instance hasn't been set, set it now. |
|
44 | + if ( null === self::$instance ) { |
|
45 | + self::$instance = new self(); |
|
46 | + } |
|
47 | + return self::$instance; |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * Load lsx team related css. |
|
52 | - * |
|
53 | - * @package lsx |
|
54 | - * @subpackage lsx-health-plan |
|
55 | - * |
|
56 | - */ |
|
57 | - public function assets() { |
|
58 | - wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER ); |
|
59 | - } |
|
50 | + /** |
|
51 | + * Load lsx team related css. |
|
52 | + * |
|
53 | + * @package lsx |
|
54 | + * @subpackage lsx-health-plan |
|
55 | + * |
|
56 | + */ |
|
57 | + public function assets() { |
|
58 | + wp_enqueue_style( 'lsx-health-plan-team', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan-team.css', array(), LSX_HEALTH_PLAN_VER ); |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * Define the related team member metabox and field configurations. |
|
63 | - */ |
|
64 | - public function related_team_metabox() { |
|
65 | - foreach ( $this->default_types as $type => $default_type ) { |
|
66 | - $cmb = new_cmb2_box( |
|
67 | - array( |
|
68 | - 'id' => $default_type . '_related_team_member__metabox', |
|
69 | - 'title' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
70 | - 'object_types' => array( $default_type ), // Post type. |
|
71 | - 'context' => 'normal', |
|
72 | - 'priority' => 'low', |
|
73 | - 'show_names' => true, |
|
74 | - ) |
|
75 | - ); |
|
61 | + /** |
|
62 | + * Define the related team member metabox and field configurations. |
|
63 | + */ |
|
64 | + public function related_team_metabox() { |
|
65 | + foreach ( $this->default_types as $type => $default_type ) { |
|
66 | + $cmb = new_cmb2_box( |
|
67 | + array( |
|
68 | + 'id' => $default_type . '_related_team_member__metabox', |
|
69 | + 'title' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
70 | + 'object_types' => array( $default_type ), // Post type. |
|
71 | + 'context' => 'normal', |
|
72 | + 'priority' => 'low', |
|
73 | + 'show_names' => true, |
|
74 | + ) |
|
75 | + ); |
|
76 | 76 | |
77 | - $cmb->add_field( |
|
78 | - array( |
|
79 | - 'name' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
80 | - 'desc' => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type, |
|
81 | - 'id' => $default_type . '_connected_team_member', |
|
82 | - 'type' => 'post_search_ajax', |
|
83 | - 'limit' => 4, // Limit selection to X items only (default 1). |
|
84 | - 'sortable' => true, // Allow selected items to be sortable (default false). |
|
85 | - 'query_args' => array( |
|
86 | - 'post_type' => array( 'team' ), |
|
87 | - 'post_status' => array( 'publish' ), |
|
88 | - 'posts_per_page' => -1, |
|
89 | - ), |
|
90 | - ) |
|
91 | - ); |
|
92 | - } |
|
77 | + $cmb->add_field( |
|
78 | + array( |
|
79 | + 'name' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
80 | + 'desc' => __( 'Connect the related team member that applies to this ', 'lsx-health-plan' ) . $default_type, |
|
81 | + 'id' => $default_type . '_connected_team_member', |
|
82 | + 'type' => 'post_search_ajax', |
|
83 | + 'limit' => 4, // Limit selection to X items only (default 1). |
|
84 | + 'sortable' => true, // Allow selected items to be sortable (default false). |
|
85 | + 'query_args' => array( |
|
86 | + 'post_type' => array( 'team' ), |
|
87 | + 'post_status' => array( 'publish' ), |
|
88 | + 'posts_per_page' => -1, |
|
89 | + ), |
|
90 | + ) |
|
91 | + ); |
|
92 | + } |
|
93 | 93 | |
94 | - } |
|
94 | + } |
|
95 | 95 | |
96 | - /** |
|
97 | - * Adding additional custom fields to the single members, related with Health Plan. |
|
98 | - */ |
|
99 | - public function additional_single_team_metabox() { |
|
100 | - $cmb = new_cmb2_box( |
|
101 | - array( |
|
102 | - 'id' => 'lsx__team', |
|
103 | - 'title' => '', |
|
104 | - 'object_types' => array( 'team' ), // Post type. |
|
105 | - 'context' => 'normal', |
|
106 | - 'priority' => 'high', |
|
107 | - 'show_names' => true, |
|
108 | - ) |
|
109 | - ); |
|
96 | + /** |
|
97 | + * Adding additional custom fields to the single members, related with Health Plan. |
|
98 | + */ |
|
99 | + public function additional_single_team_metabox() { |
|
100 | + $cmb = new_cmb2_box( |
|
101 | + array( |
|
102 | + 'id' => 'lsx__team', |
|
103 | + 'title' => '', |
|
104 | + 'object_types' => array( 'team' ), // Post type. |
|
105 | + 'context' => 'normal', |
|
106 | + 'priority' => 'high', |
|
107 | + 'show_names' => true, |
|
108 | + ) |
|
109 | + ); |
|
110 | 110 | |
111 | - $cmb->add_field( |
|
112 | - array( |
|
113 | - 'name' => __( 'Team Member Experience', 'lsx-health-plan' ), |
|
114 | - 'desc' => __( 'Add additional experience to this team member', 'lsx-health-plan' ), |
|
115 | - 'id' => 'team_member_experience', |
|
116 | - 'type' => 'wysiwyg', |
|
117 | - ) |
|
118 | - ); |
|
111 | + $cmb->add_field( |
|
112 | + array( |
|
113 | + 'name' => __( 'Team Member Experience', 'lsx-health-plan' ), |
|
114 | + 'desc' => __( 'Add additional experience to this team member', 'lsx-health-plan' ), |
|
115 | + 'id' => 'team_member_experience', |
|
116 | + 'type' => 'wysiwyg', |
|
117 | + ) |
|
118 | + ); |
|
119 | 119 | |
120 | - $cmb->add_field( |
|
121 | - array( |
|
122 | - 'name' => __( 'Featured Plans', 'lsx-health-plan' ), |
|
123 | - 'desc' => __( 'Connect the related plans to this team member', 'lsx-health-plan' ), |
|
124 | - 'id' => 'connected_team_member_plan', |
|
125 | - 'type' => 'post_search_ajax', |
|
126 | - 'limit' => 3, |
|
127 | - 'sortable' => true, |
|
128 | - 'query_args' => array( |
|
129 | - 'post_type' => array( 'plan' ), |
|
130 | - 'post_status' => array( 'publish' ), |
|
131 | - 'posts_per_page' => -1, |
|
132 | - ), |
|
133 | - ) |
|
134 | - ); |
|
120 | + $cmb->add_field( |
|
121 | + array( |
|
122 | + 'name' => __( 'Featured Plans', 'lsx-health-plan' ), |
|
123 | + 'desc' => __( 'Connect the related plans to this team member', 'lsx-health-plan' ), |
|
124 | + 'id' => 'connected_team_member_plan', |
|
125 | + 'type' => 'post_search_ajax', |
|
126 | + 'limit' => 3, |
|
127 | + 'sortable' => true, |
|
128 | + 'query_args' => array( |
|
129 | + 'post_type' => array( 'plan' ), |
|
130 | + 'post_status' => array( 'publish' ), |
|
131 | + 'posts_per_page' => -1, |
|
132 | + ), |
|
133 | + ) |
|
134 | + ); |
|
135 | 135 | |
136 | - } |
|
136 | + } |
|
137 | 137 | |
138 | - /** |
|
139 | - * Adds custom tabs to the team member single pages. |
|
140 | - * |
|
141 | - * @return void |
|
142 | - */ |
|
143 | - public function hp_team_member_tabs() { |
|
144 | - if ( is_single() && is_singular( 'team' ) ) { |
|
145 | - require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php'; |
|
146 | - } |
|
147 | - } |
|
138 | + /** |
|
139 | + * Adds custom tabs to the team member single pages. |
|
140 | + * |
|
141 | + * @return void |
|
142 | + */ |
|
143 | + public function hp_team_member_tabs() { |
|
144 | + if ( is_single() && is_singular( 'team' ) ) { |
|
145 | + require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php'; |
|
146 | + } |
|
147 | + } |
|
148 | 148 | } |
@@ -8,169 +8,169 @@ |
||
8 | 8 | */ |
9 | 9 | class Integrations { |
10 | 10 | |
11 | - /** |
|
12 | - * Holds class instance |
|
13 | - * |
|
14 | - * @since 1.0.0 |
|
15 | - * |
|
16 | - * @var object \lsx_health_plan\classes\Integrations() |
|
17 | - */ |
|
18 | - protected static $instance = null; |
|
19 | - |
|
20 | - /** |
|
21 | - * Holds class instance |
|
22 | - * |
|
23 | - * @since 1.0.0 |
|
24 | - * |
|
25 | - * @var object \MAG_CMB2_Field_Post_Search_Ajax() |
|
26 | - */ |
|
27 | - public $cmb2_post_search_ajax = false; |
|
28 | - |
|
29 | - /** |
|
30 | - * Holds class instance |
|
31 | - * |
|
32 | - * @since 1.0.0 |
|
33 | - * |
|
34 | - * @var object \lsx_health_plan\classes\Download_Monitor() |
|
35 | - */ |
|
36 | - public $download_monitor = false; |
|
37 | - |
|
38 | - /** |
|
39 | - * Holds class instance |
|
40 | - * |
|
41 | - * @since 1.0.0 |
|
42 | - * |
|
43 | - * @var object \lsx_health_plan\classes\Woocommerce() |
|
44 | - */ |
|
45 | - public $woocommerce = false; |
|
46 | - |
|
47 | - /** |
|
48 | - * Holds class instance |
|
49 | - * |
|
50 | - * @since 1.0.0 |
|
51 | - * |
|
52 | - * @var object \lsx_health_plan\classes\WP_User_Avatar() |
|
53 | - */ |
|
54 | - public $wp_user_avatar = false; |
|
55 | - |
|
56 | - /** |
|
57 | - * Holds class instance |
|
58 | - * |
|
59 | - * @since 1.0.0 |
|
60 | - * |
|
61 | - * @var object \lsx_health_plan\classes\FacetWP() |
|
62 | - */ |
|
63 | - public $facetwp = false; |
|
64 | - |
|
65 | - /** |
|
66 | - * Constructor |
|
67 | - */ |
|
68 | - public function __construct() { |
|
69 | - add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) ); |
|
70 | - add_action( 'init', array( $this, 'download_monitor_init' ) ); |
|
71 | - add_action( 'init', array( $this, 'woocommerce_init' ) ); |
|
72 | - add_action( 'init', array( $this, 'wp_user_avatar_init' ) ); |
|
73 | - add_action( 'init', array( $this, 'facetwp_init' ) ); |
|
74 | - add_action( 'init', array( $this, 'lsx_team_init' ) ); |
|
75 | - add_action( 'init', array( $this, 'lsx_article_init' ) ); |
|
76 | - } |
|
77 | - |
|
78 | - /** |
|
79 | - * Return an instance of this class. |
|
80 | - * |
|
81 | - * @since 1.0.0 |
|
82 | - * |
|
83 | - * @return object \lsx_health_plan\classes\Integrations() A single instance of this class. |
|
84 | - */ |
|
85 | - public static function get_instance() { |
|
86 | - // If the single instance hasn't been set, set it now. |
|
87 | - if ( null === self::$instance ) { |
|
88 | - self::$instance = new self(); |
|
89 | - } |
|
90 | - return self::$instance; |
|
91 | - } |
|
92 | - |
|
93 | - /** |
|
94 | - * Includes the Post Search Ajax if it is there. |
|
95 | - * |
|
96 | - * @return void |
|
97 | - */ |
|
98 | - public function cmb2_post_search_ajax() { |
|
99 | - require_once LSX_HEALTH_PLAN_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php'; |
|
100 | - if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) { |
|
101 | - $this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance(); |
|
102 | - } |
|
103 | - } |
|
104 | - |
|
105 | - /** |
|
106 | - * Includes the Post Search Ajax if it is there. |
|
107 | - * |
|
108 | - * @return void |
|
109 | - */ |
|
110 | - public function download_monitor_init() { |
|
111 | - if ( function_exists( 'download_monitor' ) ) { |
|
112 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-download-monitor.php'; |
|
113 | - $this->download_monitor = Download_Monitor::get_instance(); |
|
114 | - } |
|
115 | - } |
|
116 | - |
|
117 | - /** |
|
118 | - * Includes the Woocommerce functions. |
|
119 | - * |
|
120 | - * @return void |
|
121 | - */ |
|
122 | - public function woocommerce_init() { |
|
123 | - if ( function_exists( 'WC' ) ) { |
|
124 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-woocommerce.php'; |
|
125 | - $this->woocommerce = Woocommerce::get_instance(); |
|
126 | - } |
|
127 | - } |
|
128 | - |
|
129 | - /** |
|
130 | - * Includes the Woocommerce functions. |
|
131 | - * |
|
132 | - * @return void |
|
133 | - */ |
|
134 | - public function wp_user_avatar_init() { |
|
135 | - if ( class_exists( 'WP_User_Avatar_Setup' ) ) { |
|
136 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-wp-user-avatar.php'; |
|
137 | - $this->wp_user_avatar = WP_User_Avatar::get_instance(); |
|
138 | - } |
|
139 | - } |
|
140 | - |
|
141 | - /** |
|
142 | - * Includes the FacetWP Indexer Filters. |
|
143 | - * |
|
144 | - * @return void |
|
145 | - */ |
|
146 | - public function facetwp_init() { |
|
147 | - if ( class_exists( 'FacetWP' ) ) { |
|
148 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-facetwp.php'; |
|
149 | - $this->facetwp = FacetWP::get_instance(); |
|
150 | - } |
|
151 | - } |
|
152 | - |
|
153 | - /** |
|
154 | - * Includes the LSX Team Integration. |
|
155 | - * |
|
156 | - * @return void |
|
157 | - */ |
|
158 | - public function lsx_team_init() { |
|
159 | - if ( class_exists( 'LSX_Team' ) ) { |
|
160 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-lsx-team.php'; |
|
161 | - $this->team = LSX_Team::get_instance(); |
|
162 | - } |
|
163 | - } |
|
164 | - |
|
165 | - /** |
|
166 | - * Includes the Blog Integration. |
|
167 | - * |
|
168 | - * @return void |
|
169 | - */ |
|
170 | - public function lsx_article_init() { |
|
171 | - if ( wp_count_posts()->publish > 0 ) { |
|
172 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-articles.php'; |
|
173 | - $this->article = Articles::get_instance(); |
|
174 | - } |
|
175 | - } |
|
11 | + /** |
|
12 | + * Holds class instance |
|
13 | + * |
|
14 | + * @since 1.0.0 |
|
15 | + * |
|
16 | + * @var object \lsx_health_plan\classes\Integrations() |
|
17 | + */ |
|
18 | + protected static $instance = null; |
|
19 | + |
|
20 | + /** |
|
21 | + * Holds class instance |
|
22 | + * |
|
23 | + * @since 1.0.0 |
|
24 | + * |
|
25 | + * @var object \MAG_CMB2_Field_Post_Search_Ajax() |
|
26 | + */ |
|
27 | + public $cmb2_post_search_ajax = false; |
|
28 | + |
|
29 | + /** |
|
30 | + * Holds class instance |
|
31 | + * |
|
32 | + * @since 1.0.0 |
|
33 | + * |
|
34 | + * @var object \lsx_health_plan\classes\Download_Monitor() |
|
35 | + */ |
|
36 | + public $download_monitor = false; |
|
37 | + |
|
38 | + /** |
|
39 | + * Holds class instance |
|
40 | + * |
|
41 | + * @since 1.0.0 |
|
42 | + * |
|
43 | + * @var object \lsx_health_plan\classes\Woocommerce() |
|
44 | + */ |
|
45 | + public $woocommerce = false; |
|
46 | + |
|
47 | + /** |
|
48 | + * Holds class instance |
|
49 | + * |
|
50 | + * @since 1.0.0 |
|
51 | + * |
|
52 | + * @var object \lsx_health_plan\classes\WP_User_Avatar() |
|
53 | + */ |
|
54 | + public $wp_user_avatar = false; |
|
55 | + |
|
56 | + /** |
|
57 | + * Holds class instance |
|
58 | + * |
|
59 | + * @since 1.0.0 |
|
60 | + * |
|
61 | + * @var object \lsx_health_plan\classes\FacetWP() |
|
62 | + */ |
|
63 | + public $facetwp = false; |
|
64 | + |
|
65 | + /** |
|
66 | + * Constructor |
|
67 | + */ |
|
68 | + public function __construct() { |
|
69 | + add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) ); |
|
70 | + add_action( 'init', array( $this, 'download_monitor_init' ) ); |
|
71 | + add_action( 'init', array( $this, 'woocommerce_init' ) ); |
|
72 | + add_action( 'init', array( $this, 'wp_user_avatar_init' ) ); |
|
73 | + add_action( 'init', array( $this, 'facetwp_init' ) ); |
|
74 | + add_action( 'init', array( $this, 'lsx_team_init' ) ); |
|
75 | + add_action( 'init', array( $this, 'lsx_article_init' ) ); |
|
76 | + } |
|
77 | + |
|
78 | + /** |
|
79 | + * Return an instance of this class. |
|
80 | + * |
|
81 | + * @since 1.0.0 |
|
82 | + * |
|
83 | + * @return object \lsx_health_plan\classes\Integrations() A single instance of this class. |
|
84 | + */ |
|
85 | + public static function get_instance() { |
|
86 | + // If the single instance hasn't been set, set it now. |
|
87 | + if ( null === self::$instance ) { |
|
88 | + self::$instance = new self(); |
|
89 | + } |
|
90 | + return self::$instance; |
|
91 | + } |
|
92 | + |
|
93 | + /** |
|
94 | + * Includes the Post Search Ajax if it is there. |
|
95 | + * |
|
96 | + * @return void |
|
97 | + */ |
|
98 | + public function cmb2_post_search_ajax() { |
|
99 | + require_once LSX_HEALTH_PLAN_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php'; |
|
100 | + if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) { |
|
101 | + $this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance(); |
|
102 | + } |
|
103 | + } |
|
104 | + |
|
105 | + /** |
|
106 | + * Includes the Post Search Ajax if it is there. |
|
107 | + * |
|
108 | + * @return void |
|
109 | + */ |
|
110 | + public function download_monitor_init() { |
|
111 | + if ( function_exists( 'download_monitor' ) ) { |
|
112 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-download-monitor.php'; |
|
113 | + $this->download_monitor = Download_Monitor::get_instance(); |
|
114 | + } |
|
115 | + } |
|
116 | + |
|
117 | + /** |
|
118 | + * Includes the Woocommerce functions. |
|
119 | + * |
|
120 | + * @return void |
|
121 | + */ |
|
122 | + public function woocommerce_init() { |
|
123 | + if ( function_exists( 'WC' ) ) { |
|
124 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-woocommerce.php'; |
|
125 | + $this->woocommerce = Woocommerce::get_instance(); |
|
126 | + } |
|
127 | + } |
|
128 | + |
|
129 | + /** |
|
130 | + * Includes the Woocommerce functions. |
|
131 | + * |
|
132 | + * @return void |
|
133 | + */ |
|
134 | + public function wp_user_avatar_init() { |
|
135 | + if ( class_exists( 'WP_User_Avatar_Setup' ) ) { |
|
136 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-wp-user-avatar.php'; |
|
137 | + $this->wp_user_avatar = WP_User_Avatar::get_instance(); |
|
138 | + } |
|
139 | + } |
|
140 | + |
|
141 | + /** |
|
142 | + * Includes the FacetWP Indexer Filters. |
|
143 | + * |
|
144 | + * @return void |
|
145 | + */ |
|
146 | + public function facetwp_init() { |
|
147 | + if ( class_exists( 'FacetWP' ) ) { |
|
148 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-facetwp.php'; |
|
149 | + $this->facetwp = FacetWP::get_instance(); |
|
150 | + } |
|
151 | + } |
|
152 | + |
|
153 | + /** |
|
154 | + * Includes the LSX Team Integration. |
|
155 | + * |
|
156 | + * @return void |
|
157 | + */ |
|
158 | + public function lsx_team_init() { |
|
159 | + if ( class_exists( 'LSX_Team' ) ) { |
|
160 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-lsx-team.php'; |
|
161 | + $this->team = LSX_Team::get_instance(); |
|
162 | + } |
|
163 | + } |
|
164 | + |
|
165 | + /** |
|
166 | + * Includes the Blog Integration. |
|
167 | + * |
|
168 | + * @return void |
|
169 | + */ |
|
170 | + public function lsx_article_init() { |
|
171 | + if ( wp_count_posts()->publish > 0 ) { |
|
172 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-articles.php'; |
|
173 | + $this->article = Articles::get_instance(); |
|
174 | + } |
|
175 | + } |
|
176 | 176 | } |