@@ -8,142 +8,142 @@ |
||
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 | |
149 | 149 | } |
@@ -20,16 +20,16 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function __construct() { |
22 | 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' ), |
|
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 | 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' ) ); |
|
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 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function get_instance() { |
43 | 43 | // If the single instance hasn't been set, set it now. |
44 | - if ( null === self::$instance ) { |
|
44 | + if (null === self::$instance) { |
|
45 | 45 | self::$instance = new self(); |
46 | 46 | } |
47 | 47 | return self::$instance; |
@@ -55,19 +55,19 @@ discard block |
||
55 | 55 | * |
56 | 56 | */ |
57 | 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 ); |
|
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 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | 62 | * Define the related team member metabox and field configurations. |
63 | 63 | */ |
64 | 64 | public function related_team_metabox() { |
65 | - foreach ( $this->default_types as $type => $default_type ) { |
|
65 | + foreach ($this->default_types as $type => $default_type) { |
|
66 | 66 | $cmb = new_cmb2_box( |
67 | 67 | array( |
68 | 68 | 'id' => $default_type . '_related_team_member__metabox', |
69 | - 'title' => __( 'Related Team Member', 'lsx-health-plan' ), |
|
70 | - 'object_types' => array( $default_type ), // Post type. |
|
69 | + 'title' => __('Related Team Member', 'lsx-health-plan'), |
|
70 | + 'object_types' => array($default_type), // Post type. |
|
71 | 71 | 'context' => 'normal', |
72 | 72 | 'priority' => 'low', |
73 | 73 | 'show_names' => true, |
@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | |
77 | 77 | $cmb->add_field( |
78 | 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, |
|
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 | 81 | 'id' => $default_type . '_connected_team_member', |
82 | 82 | 'type' => 'post_search_ajax', |
83 | - 'limit' => 4, // Limit selection to X items only (default 1). |
|
83 | + 'limit' => 4, // Limit selection to X items only (default 1). |
|
84 | 84 | 'sortable' => true, // Allow selected items to be sortable (default false). |
85 | 85 | 'query_args' => array( |
86 | - 'post_type' => array( 'team' ), |
|
87 | - 'post_status' => array( 'publish' ), |
|
86 | + 'post_type' => array('team'), |
|
87 | + 'post_status' => array('publish'), |
|
88 | 88 | 'posts_per_page' => -1, |
89 | 89 | ), |
90 | 90 | ) |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | array( |
102 | 102 | 'id' => 'lsx__team', |
103 | 103 | 'title' => '', |
104 | - 'object_types' => array( 'team' ), // Post type. |
|
104 | + 'object_types' => array('team'), // Post type. |
|
105 | 105 | 'context' => 'normal', |
106 | 106 | 'priority' => 'high', |
107 | 107 | 'show_names' => true, |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | |
111 | 111 | $cmb->add_field( |
112 | 112 | array( |
113 | - 'name' => __( 'Team Member Experience', 'lsx-health-plan' ), |
|
114 | - 'desc' => __( 'Add additional experience to this team member', 'lsx-health-plan' ), |
|
113 | + 'name' => __('Team Member Experience', 'lsx-health-plan'), |
|
114 | + 'desc' => __('Add additional experience to this team member', 'lsx-health-plan'), |
|
115 | 115 | 'id' => 'team_member_experience', |
116 | 116 | 'type' => 'wysiwyg', |
117 | 117 | ) |
@@ -119,15 +119,15 @@ discard block |
||
119 | 119 | |
120 | 120 | $cmb->add_field( |
121 | 121 | array( |
122 | - 'name' => __( 'Featured Plans', 'lsx-health-plan' ), |
|
123 | - 'desc' => __( 'Connect the related plans to this team member', 'lsx-health-plan' ), |
|
122 | + 'name' => __('Featured Plans', 'lsx-health-plan'), |
|
123 | + 'desc' => __('Connect the related plans to this team member', 'lsx-health-plan'), |
|
124 | 124 | 'id' => 'connected_team_member_plan', |
125 | 125 | 'type' => 'post_search_ajax', |
126 | 126 | 'limit' => 3, |
127 | 127 | 'sortable' => true, |
128 | 128 | 'query_args' => array( |
129 | - 'post_type' => array( 'plan' ), |
|
130 | - 'post_status' => array( 'publish' ), |
|
129 | + 'post_type' => array('plan'), |
|
130 | + 'post_status' => array('publish'), |
|
131 | 131 | 'posts_per_page' => -1, |
132 | 132 | ), |
133 | 133 | ) |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @return void |
142 | 142 | */ |
143 | 143 | public function hp_team_member_tabs() { |
144 | - if ( is_single() && is_singular( 'team' ) ) { |
|
144 | + if (is_single() && is_singular('team')) { |
|
145 | 145 | require_once LSX_HEALTH_PLAN_PATH . '/includes/template-tags/team.php'; |
146 | 146 | } |
147 | 147 | } |
@@ -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 |
@@ -19,15 +19,15 @@ discard block |
||
19 | 19 | $tab_testimonial['content'] = ''; |
20 | 20 | |
21 | 21 | if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) { |
22 | - if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
23 | - $columns = count( $tab_testimonial['posts'] ); |
|
24 | - } else { |
|
25 | - $columns = 3; |
|
26 | - } |
|
27 | - |
|
28 | - $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
29 | - $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
|
30 | - $tabs[] = $tab_testimonial; |
|
22 | + if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
23 | + $columns = count( $tab_testimonial['posts'] ); |
|
24 | + } else { |
|
25 | + $columns = 3; |
|
26 | + } |
|
27 | + |
|
28 | + $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
29 | + $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
|
30 | + $tabs[] = $tab_testimonial; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | if ( count( $tabs ) > 0 ) : ?> |
@@ -3,10 +3,10 @@ discard block |
||
3 | 3 | $tabs = array(); |
4 | 4 | |
5 | 5 | // Tab Experience |
6 | -$tab_experience['title'] = esc_html__( 'Experience', 'lsx-team' ); |
|
7 | -$tab_experience['content'] = get_post_meta( get_the_ID(), 'team_member_experience', true ); |
|
6 | +$tab_experience['title'] = esc_html__('Experience', 'lsx-team'); |
|
7 | +$tab_experience['content'] = get_post_meta(get_the_ID(), 'team_member_experience', true); |
|
8 | 8 | $tab_experience['shortcode'] = ''; |
9 | -if ( ! empty( $tab_experience['content'] ) ) { |
|
9 | +if ( ! empty($tab_experience['content'])) { |
|
10 | 10 | $tabs[] = $tab_experience; |
11 | 11 | } |
12 | 12 | |
@@ -14,34 +14,34 @@ discard block |
||
14 | 14 | |
15 | 15 | // Tab Testimonials |
16 | 16 | $tab_testimonial['post_type'] = 'testimonial'; |
17 | -$tab_testimonial['title'] = esc_html__( 'Testimonials', 'lsx-team' ); |
|
18 | -$tab_testimonial['posts'] = get_post_meta( get_the_ID(), 'testimonial_to_team', true ); |
|
17 | +$tab_testimonial['title'] = esc_html__('Testimonials', 'lsx-team'); |
|
18 | +$tab_testimonial['posts'] = get_post_meta(get_the_ID(), 'testimonial_to_team', true); |
|
19 | 19 | $tab_testimonial['content'] = ''; |
20 | 20 | |
21 | -if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) { |
|
22 | - if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
23 | - $columns = count( $tab_testimonial['posts'] ); |
|
21 | +if (is_plugin_active('lsx-testimonials/lsx-testimonials.php') && ( ! empty($tab_testimonial['posts']))) { |
|
22 | + if (count($tab_testimonial['posts']) <= 2) { |
|
23 | + $columns = count($tab_testimonial['posts']); |
|
24 | 24 | } else { |
25 | 25 | $columns = 3; |
26 | 26 | } |
27 | 27 | |
28 | - $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
28 | + $post_ids = join(',', $tab_testimonial['posts']); |
|
29 | 29 | $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
30 | 30 | $tabs[] = $tab_testimonial; |
31 | 31 | } |
32 | 32 | |
33 | -if ( count( $tabs ) > 0 ) : ?> |
|
33 | +if (count($tabs) > 0) : ?> |
|
34 | 34 | <div class="entry-tabs hp-entry-tabs"> |
35 | 35 | <ul class="nav nav-tabs"> |
36 | - <?php foreach ( $tabs as $i => $tab ) : ?> |
|
37 | - <li<?php if ( 0 === $i ) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li> |
|
36 | + <?php foreach ($tabs as $i => $tab) : ?> |
|
37 | + <li<?php if (0 === $i) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr(sanitize_title($tab['title'])); ?>"><?php echo esc_html($tab['title']); ?></a></li> |
|
38 | 38 | <?php endforeach; ?> |
39 | 39 | </ul> |
40 | 40 | |
41 | 41 | <div class="tab-content"> |
42 | - <?php foreach ( $tabs as $i => $tab ) : ?> |
|
43 | - <div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>"> |
|
44 | - <?php echo do_shortcode( $tab['shortcode'] ); ?> |
|
42 | + <?php foreach ($tabs as $i => $tab) : ?> |
|
43 | + <div id="<?php echo esc_attr(sanitize_title($tab['title'])); ?>" class="tab-pane fade<?php if (0 === $i) echo ' in active'; ?>"> |
|
44 | + <?php echo do_shortcode($tab['shortcode']); ?> |
|
45 | 45 | <?php echo $tab['content']; ?> |
46 | 46 | </div> |
47 | 47 | <?php endforeach; ?> |
@@ -34,13 +34,19 @@ |
||
34 | 34 | <div class="entry-tabs hp-entry-tabs"> |
35 | 35 | <ul class="nav nav-tabs"> |
36 | 36 | <?php foreach ( $tabs as $i => $tab ) : ?> |
37 | - <li<?php if ( 0 === $i ) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li> |
|
37 | + <li<?php if ( 0 === $i ) { |
|
38 | + echo ' class="active"'; |
|
39 | +} |
|
40 | +?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li> |
|
38 | 41 | <?php endforeach; ?> |
39 | 42 | </ul> |
40 | 43 | |
41 | 44 | <div class="tab-content"> |
42 | 45 | <?php foreach ( $tabs as $i => $tab ) : ?> |
43 | - <div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>"> |
|
46 | + <div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) { |
|
47 | + echo ' in active'; |
|
48 | +} |
|
49 | +?>"> |
|
44 | 50 | <?php echo do_shortcode( $tab['shortcode'] ); ?> |
45 | 51 | <?php echo $tab['content']; ?> |
46 | 52 | </div> |