Passed
Push — master ( 83dcc0...ce3323 )
by
unknown
13:55 queued 09:07
created
classes/admin/class-settings.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 	 * Contructor
30 30
 	 */
31 31
 	public function __construct() {
32
-		add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) );
33
-		add_action( 'lsx_team_settings_page', array( $this, 'general_settings' ), 1, 1 );
34
-		add_action( 'lsx_team_settings_page', array( $this, 'global_defaults' ), 3, 1 );
32
+		add_action('cmb2_admin_init', array($this, 'register_settings_page'));
33
+		add_action('lsx_team_settings_page', array($this, 'general_settings'), 1, 1);
34
+		add_action('lsx_team_settings_page', array($this, 'global_defaults'), 3, 1);
35 35
 	}
36 36
 
37 37
 	/**
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public static function get_instance() {
45 45
 		// If the single instance hasn't been set, set it now.
46
-		if ( null === self::$instance ) {
46
+		if (null === self::$instance) {
47 47
 			self::$instance = new self();
48 48
 		}
49 49
 		return self::$instance;
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
 		$cmb = new_cmb2_box(
57 57
 			array(
58 58
 				'id'           => $this->screen_id,
59
-				'title'        => esc_html__( 'Settings', 'lsx-team' ),
60
-				'object_types' => array( 'options-page' ),
59
+				'title'        => esc_html__('Settings', 'lsx-team'),
60
+				'object_types' => array('options-page'),
61 61
 				'option_key'   => 'lsx_team_options', // The option key and admin menu page slug.
62 62
 				'parent_slug'  => 'edit.php?post_type=team', // Make options page a submenu item of the themes menu.
63 63
 				'capability'   => 'manage_options', // Cap required to view options-page.
64 64
 			)
65 65
 		);
66
-		do_action( 'lsx_team_settings_page', $cmb );
66
+		do_action('lsx_team_settings_page', $cmb);
67 67
 	}
68 68
 
69 69
 	/**
@@ -72,39 +72,39 @@  discard block
 block discarded – undo
72 72
 	 * @param object $cmb new_cmb2_box().
73 73
 	 * @return void
74 74
 	 */
75
-	public function general_settings( $cmb ) {
75
+	public function general_settings($cmb) {
76 76
 		$cmb->add_field(
77 77
 			array(
78 78
 				'id'      => 'settings_general_title',
79 79
 				'type'    => 'title',
80
-				'name'    => __( 'General', 'lsx-team' ),
81
-				'default' => __( 'General', 'lsx-team' ),
80
+				'name'    => __('General', 'lsx-team'),
81
+				'default' => __('General', 'lsx-team'),
82 82
 			)
83 83
 		);
84 84
 		$cmb->add_field(
85 85
 			array(
86
-				'name'        => __( 'Disable Single Posts', 'lsx-team' ),
86
+				'name'        => __('Disable Single Posts', 'lsx-team'),
87 87
 				'id'          => 'team_disable_single',
88 88
 				'type'        => 'checkbox',
89 89
 				'value'       => 1,
90 90
 				'default'     => 0,
91
-				'description' => __( 'Disable Single Posts.', 'lsx-health-plan' ),
91
+				'description' => __('Disable Single Posts.', 'lsx-health-plan'),
92 92
 			)
93 93
 		);
94 94
 
95 95
 		$cmb->add_field(
96 96
 			array(
97
-				'name'        => __( 'Group By Role', 'lsx-team' ),
97
+				'name'        => __('Group By Role', 'lsx-team'),
98 98
 				'id'          => 'group_by_role',
99 99
 				'type'        => 'checkbox',
100 100
 				'value'       => 1,
101 101
 				'default'     => 0,
102
-				'description' => __( 'This setting creates Role sub-headings on the Team Member archive.', 'lsx-health-plan' ),
102
+				'description' => __('This setting creates Role sub-headings on the Team Member archive.', 'lsx-health-plan'),
103 103
 			)
104 104
 		);
105
-		$cmb->add_field( array(
105
+		$cmb->add_field(array(
106 106
 			'name'    => 'Placeholder',
107
-			'desc'    => __( 'This image displays on the archive, search results and team members single if no featured image is set.', 'lsx-health-plan' ),
107
+			'desc'    => __('This image displays on the archive, search results and team members single if no featured image is set.', 'lsx-health-plan'),
108 108
 			'id'      => 'team_placeholder',
109 109
 			'type'    => 'file',
110 110
 			'options' => array(
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			'text'    => array(
114 114
 				'add_upload_file_text' => 'Choose Image',
115 115
 			),
116
-		) );
116
+		));
117 117
 		$cmb->add_field(
118 118
 			array(
119 119
 				'id'   => 'settings_general_closing',
@@ -128,30 +128,30 @@  discard block
 block discarded – undo
128 128
 	 * @param object $cmb new_cmb2_box().
129 129
 	 * @return void
130 130
 	 */
131
-	public function global_defaults( $cmb ) {
131
+	public function global_defaults($cmb) {
132 132
 		$cmb->add_field(
133 133
 			array(
134 134
 				'id'      => 'global_defaults_title',
135 135
 				'type'    => 'title',
136
-				'name'    => __( 'Careers CTA', 'lsx-team' ),
137
-				'default' => __( 'Careers CTA', 'lsx-team' ),
136
+				'name'    => __('Careers CTA', 'lsx-team'),
137
+				'default' => __('Careers CTA', 'lsx-team'),
138 138
 			)
139 139
 		);
140 140
 
141 141
 		$cmb->add_field(
142 142
 			array(
143
-				'name'        => __( 'Enable careers CTA', 'lsx-team' ),
143
+				'name'        => __('Enable careers CTA', 'lsx-team'),
144 144
 				'id'          => 'team_careers_cta_enable',
145 145
 				'type'        => 'checkbox',
146 146
 				'value'       => 1,
147 147
 				'default'     => 0,
148
-				'description' => __( 'Displays careers CTA mystery man on team archive.', 'lsx-health-plan' ),
148
+				'description' => __('Displays careers CTA mystery man on team archive.', 'lsx-health-plan'),
149 149
 			)
150 150
 		);
151 151
 
152 152
 		$cmb->add_field(
153 153
 			array(
154
-				'name' => __( 'Title', 'lsx-team' ),
154
+				'name' => __('Title', 'lsx-team'),
155 155
 				'id'   => 'team_careers_cta_title',
156 156
 				'type' => 'text',
157 157
 			)
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
 		$cmb->add_field(
161 161
 			array(
162
-				'name' => __( 'Tagline', 'lsx-team' ),
162
+				'name' => __('Tagline', 'lsx-team'),
163 163
 				'id'   => 'team_careers_cta_tagline',
164 164
 				'type' => 'text',
165 165
 			)
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
 		$cmb->add_field(
169 169
 			array(
170
-				'name' => __( 'Link Text', 'lsx-team' ),
170
+				'name' => __('Link Text', 'lsx-team'),
171 171
 				'id'   => 'team_careers_cta_link_text',
172 172
 				'type' => 'text',
173 173
 			)
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
 		$cmb->add_field(
177 177
 			array(
178
-				'name' => __( 'Careers page link', 'lsx-team' ),
178
+				'name' => __('Careers page link', 'lsx-team'),
179 179
 				'id'   => 'team_careers_cta_link',
180 180
 				'type' => 'text',
181 181
 			)
Please login to merge, or discard this patch.
classes/class-lsx-team-admin.php 1 patch
Spacing   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -14,46 +14,46 @@  discard block
 block discarded – undo
14 14
 	public function __construct() {
15 15
 		$this->load_classes();
16 16
 
17
-		add_action( 'init', array( $this, 'post_type_setup' ) );
18
-		add_action( 'init', array( $this, 'taxonomy_setup' ) );
17
+		add_action('init', array($this, 'post_type_setup'));
18
+		add_action('init', array($this, 'taxonomy_setup'));
19 19
 
20
-		add_action( 'cmb2_admin_init', array( $this, 'details_metabox' ) );
21
-		add_action( 'cmb2_admin_init', array( $this, 'projects_details_metabox' ) );
22
-		add_action( 'cmb2_admin_init', array( $this, 'services_details_metabox' ) );
23
-		add_action( 'cmb2_admin_init', array( $this, 'testimonials_details_metabox' ) );
20
+		add_action('cmb2_admin_init', array($this, 'details_metabox'));
21
+		add_action('cmb2_admin_init', array($this, 'projects_details_metabox'));
22
+		add_action('cmb2_admin_init', array($this, 'services_details_metabox'));
23
+		add_action('cmb2_admin_init', array($this, 'testimonials_details_metabox'));
24 24
 
25
-		add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) );
25
+		add_action('admin_enqueue_scripts', array($this, 'assets'));
26 26
 
27
-		add_filter( 'type_url_form_media', array( $this, 'change_attachment_field_button' ), 20, 1 );
28
-		add_filter( 'enter_title_here', array( $this, 'change_title_text' ) );
27
+		add_filter('type_url_form_media', array($this, 'change_attachment_field_button'), 20, 1);
28
+		add_filter('enter_title_here', array($this, 'change_title_text'));
29 29
 	}
30 30
 
31 31
 	/**
32 32
 	 * Loads the admin subclasses
33 33
 	 */
34 34
 	private function load_classes() {
35
-		require_once LSX_TEAM_PATH . 'classes/admin/class-settings.php';
35
+		require_once LSX_TEAM_PATH.'classes/admin/class-settings.php';
36 36
 		$this->settings = \lsx\team\classes\admin\Settings::get_instance();
37 37
 
38
-		require_once LSX_TEAM_PATH . 'classes/admin/class-settings-theme.php';
38
+		require_once LSX_TEAM_PATH.'classes/admin/class-settings-theme.php';
39 39
 		$this->settings_theme = \lsx\team\classes\admin\Settings_Theme::get_instance();
40 40
 	}
41 41
 
42 42
 	public function post_type_setup() {
43 43
 		$labels = array(
44
-			'name'               => esc_html_x( 'Team Members', 'post type general name', 'lsx-team' ),
45
-			'singular_name'      => esc_html_x( 'Team Member', 'post type singular name', 'lsx-team' ),
46
-			'add_new'            => esc_html_x( 'Add New', 'post type general name', 'lsx-team' ),
47
-			'add_new_item'       => esc_html__( 'Add New Team Member', 'lsx-team' ),
48
-			'edit_item'          => esc_html__( 'Edit Team Member', 'lsx-team' ),
49
-			'new_item'           => esc_html__( 'New Team Member', 'lsx-team' ),
50
-			'all_items'          => esc_html__( 'All Team Members', 'lsx-team' ),
51
-			'view_item'          => esc_html__( 'View Team Member', 'lsx-team' ),
52
-			'search_items'       => esc_html__( 'Search Team Members', 'lsx-team' ),
53
-			'not_found'          => esc_html__( 'No team members found', 'lsx-team' ),
54
-			'not_found_in_trash' => esc_html__( 'No team members found in Trash', 'lsx-team' ),
44
+			'name'               => esc_html_x('Team Members', 'post type general name', 'lsx-team'),
45
+			'singular_name'      => esc_html_x('Team Member', 'post type singular name', 'lsx-team'),
46
+			'add_new'            => esc_html_x('Add New', 'post type general name', 'lsx-team'),
47
+			'add_new_item'       => esc_html__('Add New Team Member', 'lsx-team'),
48
+			'edit_item'          => esc_html__('Edit Team Member', 'lsx-team'),
49
+			'new_item'           => esc_html__('New Team Member', 'lsx-team'),
50
+			'all_items'          => esc_html__('All Team Members', 'lsx-team'),
51
+			'view_item'          => esc_html__('View Team Member', 'lsx-team'),
52
+			'search_items'       => esc_html__('Search Team Members', 'lsx-team'),
53
+			'not_found'          => esc_html__('No team members found', 'lsx-team'),
54
+			'not_found_in_trash' => esc_html__('No team members found in Trash', 'lsx-team'),
55 55
 			'parent_item_colon'  => '',
56
-			'menu_name'          => esc_html_x( 'Team Members', 'admin menu', 'lsx-team' ),
56
+			'menu_name'          => esc_html_x('Team Members', 'admin menu', 'lsx-team'),
57 57
 		);
58 58
 
59 59
 		$args = array(
@@ -81,22 +81,22 @@  discard block
 block discarded – undo
81 81
 			'show_in_rest'          => true,
82 82
 		);
83 83
 
84
-		register_post_type( 'team', $args );
84
+		register_post_type('team', $args);
85 85
 	}
86 86
 
87 87
 	public function taxonomy_setup() {
88 88
 		$labels = array(
89
-			'name'              => esc_html_x( 'Roles', 'taxonomy general name', 'lsx-team' ),
90
-			'singular_name'     => esc_html_x( 'Role', 'taxonomy singular name', 'lsx-team' ),
91
-			'search_items'      => esc_html__( 'Search Roles', 'lsx-team' ),
92
-			'all_items'         => esc_html__( 'All Roles', 'lsx-team' ),
93
-			'parent_item'       => esc_html__( 'Parent Role', 'lsx-team' ),
94
-			'parent_item_colon' => esc_html__( 'Parent Role:', 'lsx-team' ),
95
-			'edit_item'         => esc_html__( 'Edit Role', 'lsx-team' ),
96
-			'update_item'       => esc_html__( 'Update Role', 'lsx-team' ),
97
-			'add_new_item'      => esc_html__( 'Add New Role', 'lsx-team' ),
98
-			'new_item_name'     => esc_html__( 'New Role Name', 'lsx-team' ),
99
-			'menu_name'         => esc_html__( 'Roles', 'lsx-team' ),
89
+			'name'              => esc_html_x('Roles', 'taxonomy general name', 'lsx-team'),
90
+			'singular_name'     => esc_html_x('Role', 'taxonomy singular name', 'lsx-team'),
91
+			'search_items'      => esc_html__('Search Roles', 'lsx-team'),
92
+			'all_items'         => esc_html__('All Roles', 'lsx-team'),
93
+			'parent_item'       => esc_html__('Parent Role', 'lsx-team'),
94
+			'parent_item_colon' => esc_html__('Parent Role:', 'lsx-team'),
95
+			'edit_item'         => esc_html__('Edit Role', 'lsx-team'),
96
+			'update_item'       => esc_html__('Update Role', 'lsx-team'),
97
+			'add_new_item'      => esc_html__('Add New Role', 'lsx-team'),
98
+			'new_item_name'     => esc_html__('New Role Name', 'lsx-team'),
99
+			'menu_name'         => esc_html__('Roles', 'lsx-team'),
100 100
 		);
101 101
 
102 102
 		$args = array(
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			'show_in_rest'          => true,
112 112
 		);
113 113
 
114
-		register_taxonomy( 'team_role', array( 'team' ), $args );
114
+		register_taxonomy('team_role', array('team'), $args);
115 115
 	}
116 116
 
117 117
 	/**
@@ -121,23 +121,23 @@  discard block
 block discarded – undo
121 121
 
122 122
 		$prefix = 'lsx_';
123 123
 
124
-		$users = get_transient( 'lsx_team_users' );
124
+		$users = get_transient('lsx_team_users');
125 125
 
126
-		if ( false === $users || '' === $users ) {
127
-			$users = get_users( array(
128
-				'role__in' => array( 'administrator', 'editor', 'author' ),
129
-			) );
130
-			set_transient( 'lsx_team_users', $users, 5 * 60 );
126
+		if (false === $users || '' === $users) {
127
+			$users = get_users(array(
128
+				'role__in' => array('administrator', 'editor', 'author'),
129
+			));
130
+			set_transient('lsx_team_users', $users, 5 * 60);
131 131
 		}
132 132
 
133
-		foreach ( $users as $user ) {
133
+		foreach ($users as $user) {
134 134
 			$user_array[$user->ID] = $user->user_login;
135 135
 		}
136 136
 
137 137
 		$cmb = new_cmb2_box(
138 138
 			array(
139
-				'id'           => $prefix . '_team',
140
-				'title'        => esc_html__( 'Team Member Details', 'lsx-team' ),
139
+				'id'           => $prefix.'_team',
140
+				'title'        => esc_html__('Team Member Details', 'lsx-team'),
141 141
 				'object_types' => 'team',
142 142
 				'context'      => 'normal',
143 143
 				'priority'     => 'low',
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 
148 148
 		$cmb->add_field(
149 149
 			array(
150
-				'name'         => esc_html__( 'Featured:', 'lsx-team' ),
151
-				'id'           => $prefix . 'featured',
150
+				'name'         => esc_html__('Featured:', 'lsx-team'),
151
+				'id'           => $prefix.'featured',
152 152
 				'type'         => 'checkbox',
153 153
 				'value'        => 1,
154 154
 				'default'      => 0,
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 
159 159
 		$cmb->add_field(
160 160
 			array(
161
-				'name'         => esc_html__( 'Site User', 'lsx-team' ),
162
-				'id'           => $prefix . 'site_user',
161
+				'name'         => esc_html__('Site User', 'lsx-team'),
162
+				'id'           => $prefix.'site_user',
163 163
 				'allow_none'   => true,
164 164
 				'type'         => 'select',
165 165
 				'options'      => $user_array,
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 
170 170
 		$cmb->add_field(
171 171
 			array(
172
-				'name'         => esc_html__( 'Job Title:', 'lsx-team' ),
173
-				'id'           => $prefix . 'job_title',
172
+				'name'         => esc_html__('Job Title:', 'lsx-team'),
173
+				'id'           => $prefix.'job_title',
174 174
 				'type'         => 'text',
175 175
 				'show_in_rest' => true,
176 176
 			)
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 
179 179
 		$cmb->add_field(
180 180
 			array(
181
-				'name'         => esc_html__( 'Location:', 'lsx-team' ),
182
-				'id'           => $prefix . 'location',
181
+				'name'         => esc_html__('Location:', 'lsx-team'),
182
+				'id'           => $prefix.'location',
183 183
 				'type'         => 'text',
184 184
 				'show_in_rest' => true,
185 185
 			)
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 
188 188
 		$cmb->add_field(
189 189
 			array(
190
-				'name'         => esc_html__( 'Contact Email Address:', 'lsx-team' ),
191
-				'id'           => $prefix . 'email_contact',
190
+				'name'         => esc_html__('Contact Email Address:', 'lsx-team'),
191
+				'id'           => $prefix.'email_contact',
192 192
 				'type'         => 'text',
193 193
 				'show_in_rest' => true,
194 194
 			)
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
 
197 197
 		$cmb->add_field(
198 198
 			array(
199
-				'name'         => esc_html__( 'Gravatar Email Address:', 'lsx-team' ),
200
-				'desc'         => esc_html__( 'Used for Gravatar if a featured image is not set', 'lsx-team' ),
201
-				'id'           => $prefix . 'email_gravatar',
199
+				'name'         => esc_html__('Gravatar Email Address:', 'lsx-team'),
200
+				'desc'         => esc_html__('Used for Gravatar if a featured image is not set', 'lsx-team'),
201
+				'id'           => $prefix.'email_gravatar',
202 202
 				'type'         => 'text',
203 203
 				'show_in_rest' => true,
204 204
 			)
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
 
207 207
 		$cmb->add_field(
208 208
 			array(
209
-				'name'         => esc_html__( 'Telephone Number:', 'lsx-team' ),
210
-				'id'           => $prefix . 'tel',
209
+				'name'         => esc_html__('Telephone Number:', 'lsx-team'),
210
+				'id'           => $prefix.'tel',
211 211
 				'type'         => 'text',
212 212
 				'show_in_rest' => true,
213 213
 			)
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 
216 216
 		$cmb->add_field(
217 217
 			array(
218
-				'name'         => esc_html__( 'Skype Name:', 'lsx-team' ),
219
-				'id'           => $prefix . 'skype',
218
+				'name'         => esc_html__('Skype Name:', 'lsx-team'),
219
+				'id'           => $prefix.'skype',
220 220
 				'type'         => 'text',
221 221
 				'show_in_rest' => true,
222 222
 			)
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
 
225 225
 		$cmb->add_field(
226 226
 			array(
227
-				'name'         => esc_html__( 'Facebook URL', 'lsx-team' ),
228
-				'id'           => $prefix . 'facebook',
227
+				'name'         => esc_html__('Facebook URL', 'lsx-team'),
228
+				'id'           => $prefix.'facebook',
229 229
 				'type'         => 'text_url',
230 230
 				'show_in_rest' => true,
231 231
 			)
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
 
234 234
 		$cmb->add_field(
235 235
 			array(
236
-				'name'         => esc_html__( 'Twitter URL', 'lsx-team' ),
237
-				'id'           => $prefix . 'twitter',
236
+				'name'         => esc_html__('Twitter URL', 'lsx-team'),
237
+				'id'           => $prefix.'twitter',
238 238
 				'type'         => 'text_url',
239 239
 				'show_in_rest' => true,
240 240
 			)
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
 
243 243
 		$cmb->add_field(
244 244
 			array(
245
-				'name'         => esc_html__( 'LinkedIn URL', 'lsx-team' ),
246
-				'id'           => $prefix . 'linkedin',
245
+				'name'         => esc_html__('LinkedIn URL', 'lsx-team'),
246
+				'id'           => $prefix.'linkedin',
247 247
 				'type'         => 'text_url',
248 248
 				'show_in_rest' => true,
249 249
 			)
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
 
252 252
 		$cmb->add_field(
253 253
 			array(
254
-				'name'         => esc_html__( 'Github URL', 'lsx-team' ),
255
-				'id'           => $prefix . 'github',
254
+				'name'         => esc_html__('Github URL', 'lsx-team'),
255
+				'id'           => $prefix.'github',
256 256
 				'type'         => 'text_url',
257 257
 				'show_in_rest' => true,
258 258
 			)
@@ -260,8 +260,8 @@  discard block
 block discarded – undo
260 260
 
261 261
 		$cmb->add_field(
262 262
 			array(
263
-				'name'         => esc_html__( 'WordPress URL', 'lsx-team' ),
264
-				'id'           => $prefix . 'wordpress',
263
+				'name'         => esc_html__('WordPress URL', 'lsx-team'),
264
+				'id'           => $prefix.'wordpress',
265 265
 				'type'         => 'text_url',
266 266
 				'show_in_rest' => true,
267 267
 			)
@@ -273,29 +273,29 @@  discard block
 block discarded – undo
273 273
 	 */
274 274
 	public function projects_details_metabox() {
275 275
 
276
-		if ( class_exists( 'LSX_Projects' ) ) {
276
+		if (class_exists('LSX_Projects')) {
277 277
 
278 278
 			$prefix = 'lsx_';
279 279
 
280 280
 			$cmb = new_cmb2_box(
281 281
 				array(
282
-					'id'           => $prefix . '_team',
282
+					'id'           => $prefix.'_team',
283 283
 					'context'      => 'normal',
284 284
 					'priority'     => 'low',
285 285
 					'show_names'   => true,
286
-					'object_types' => array( 'team' ),
286
+					'object_types' => array('team'),
287 287
 				)
288 288
 			);
289 289
 			$cmb->add_field(
290 290
 				array(
291
-					'name'       => __( 'Projects:', 'lsx-team' ),
291
+					'name'       => __('Projects:', 'lsx-team'),
292 292
 					'id'         => 'project_to_team',
293 293
 					'type'       => 'post_search_ajax',
294 294
 					'limit'      => 15,
295 295
 					'sortable'   => true,
296 296
 					'query_args' => array(
297
-						'post_type'      => array( 'project' ),
298
-						'post_status'    => array( 'publish' ),
297
+						'post_type'      => array('project'),
298
+						'post_status'    => array('publish'),
299 299
 						'posts_per_page' => -1,
300 300
 					),
301 301
 				)
@@ -308,29 +308,29 @@  discard block
 block discarded – undo
308 308
 	 */
309 309
 	public function services_details_metabox() {
310 310
 
311
-		if ( class_exists( 'LSX_Services' ) ) {
311
+		if (class_exists('LSX_Services')) {
312 312
 
313 313
 			$prefix = 'lsx_';
314 314
 
315 315
 			$cmb = new_cmb2_box(
316 316
 				array(
317
-					'id'           => $prefix . '_team',
317
+					'id'           => $prefix.'_team',
318 318
 					'context'      => 'normal',
319 319
 					'priority'     => 'low',
320 320
 					'show_names'   => true,
321
-					'object_types' => array( 'team' ),
321
+					'object_types' => array('team'),
322 322
 				)
323 323
 			);
324 324
 			$cmb->add_field(
325 325
 				array(
326
-					'name'       => __( 'Services:', 'lsx-team' ),
326
+					'name'       => __('Services:', 'lsx-team'),
327 327
 					'id'         => 'service_to_team',
328 328
 					'type'       => 'post_search_ajax',
329 329
 					'limit'      => 15,
330 330
 					'sortable'   => true,
331 331
 					'query_args' => array(
332
-						'post_type'      => array( 'service' ),
333
-						'post_status'    => array( 'publish' ),
332
+						'post_type'      => array('service'),
333
+						'post_status'    => array('publish'),
334 334
 						'posts_per_page' => -1,
335 335
 					),
336 336
 				)
@@ -343,29 +343,29 @@  discard block
 block discarded – undo
343 343
 	 */
344 344
 	public function testimonials_details_metabox() {
345 345
 
346
-		if ( class_exists( 'LSX_Testimonials' ) ) {
346
+		if (class_exists('LSX_Testimonials')) {
347 347
 
348 348
 			$prefix = 'lsx_';
349 349
 
350 350
 			$cmb = new_cmb2_box(
351 351
 				array(
352
-					'id'           => $prefix . '_team',
352
+					'id'           => $prefix.'_team',
353 353
 					'context'      => 'normal',
354 354
 					'priority'     => 'low',
355 355
 					'show_names'   => true,
356
-					'object_types' => array( 'team' ),
356
+					'object_types' => array('team'),
357 357
 				)
358 358
 			);
359 359
 			$cmb->add_field(
360 360
 				array(
361
-					'name'       => __( 'Testimonials:', 'lsx-team' ),
361
+					'name'       => __('Testimonials:', 'lsx-team'),
362 362
 					'id'         => 'testimonial_to_team',
363 363
 					'type'       => 'post_search_ajax',
364 364
 					'limit'      => 15,
365 365
 					'sortable'   => true,
366 366
 					'query_args' => array(
367
-						'post_type'      => array( 'testimonial' ),
368
-						'post_status'    => array( 'publish' ),
367
+						'post_type'      => array('testimonial'),
368
+						'post_status'    => array('publish'),
369 369
 						'posts_per_page' => -1,
370 370
 					),
371 371
 				)
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	/**
378 378
 	 * Sets up the "post relations".
379 379
 	 */
380
-	public function post_relations( $post_id, $field, $value ) {
380
+	public function post_relations($post_id, $field, $value) {
381 381
 		$connections = array(
382 382
 			'team_to_testimonial',
383 383
 			'testimonial_to_team',
@@ -389,31 +389,31 @@  discard block
 block discarded – undo
389 389
 			'service_to_team',
390 390
 		);
391 391
 
392
-		if ( in_array( $field['id'], $connections ) ) {
393
-			$this->save_related_post( $connections, $post_id, $field, $value );
392
+		if (in_array($field['id'], $connections)) {
393
+			$this->save_related_post($connections, $post_id, $field, $value);
394 394
 		}
395 395
 	}
396 396
 
397 397
 	/**
398 398
 	 * Save the reverse post relation.
399 399
 	 */
400
-	public function save_related_post( $connections, $post_id, $field, $value ) {
401
-		$ids = explode( '_to_', $field['id'] );
402
-		$relation = $ids[1] . '_to_' . $ids[0];
400
+	public function save_related_post($connections, $post_id, $field, $value) {
401
+		$ids = explode('_to_', $field['id']);
402
+		$relation = $ids[1].'_to_'.$ids[0];
403 403
 
404
-		if ( in_array( $relation, $connections ) ) {
405
-			$previous_values = get_post_meta( $post_id, $field['id'], false );
404
+		if (in_array($relation, $connections)) {
405
+			$previous_values = get_post_meta($post_id, $field['id'], false);
406 406
 
407
-			if ( ! empty( $previous_values ) ) {
408
-				foreach ( $previous_values as $v ) {
409
-					delete_post_meta( $v, $relation, $post_id );
407
+			if (!empty($previous_values)) {
408
+				foreach ($previous_values as $v) {
409
+					delete_post_meta($v, $relation, $post_id);
410 410
 				}
411 411
 			}
412 412
 
413
-			if ( is_array( $value ) ) {
414
-				foreach ( $value as $v ) {
415
-					if ( ! empty( $v ) ) {
416
-						add_post_meta( $v, $relation, $post_id );
413
+			if (is_array($value)) {
414
+				foreach ($value as $v) {
415
+					if (!empty($v)) {
416
+						add_post_meta($v, $relation, $post_id);
417 417
 					}
418 418
 				}
419 419
 			}
@@ -422,30 +422,30 @@  discard block
 block discarded – undo
422 422
 
423 423
 	public function assets() {
424 424
 		//wp_enqueue_media();
425
-		wp_enqueue_script( 'media-upload' );
426
-		wp_enqueue_script( 'thickbox' );
427
-		wp_enqueue_style( 'thickbox' );
425
+		wp_enqueue_script('media-upload');
426
+		wp_enqueue_script('thickbox');
427
+		wp_enqueue_style('thickbox');
428 428
 
429
-		wp_enqueue_script( 'lsx-team-admin', LSX_TEAM_URL . 'assets/js/lsx-team-admin.min.js', array( 'jquery' ), LSX_TEAM_VER );
430
-		wp_enqueue_style( 'lsx-team-admin', LSX_TEAM_URL . 'assets/css/lsx-team-admin.css', array(), LSX_TEAM_VER );
429
+		wp_enqueue_script('lsx-team-admin', LSX_TEAM_URL.'assets/js/lsx-team-admin.min.js', array('jquery'), LSX_TEAM_VER);
430
+		wp_enqueue_style('lsx-team-admin', LSX_TEAM_URL.'assets/css/lsx-team-admin.css', array(), LSX_TEAM_VER);
431 431
 	}
432 432
 
433 433
 	/**
434 434
 	 * Change the "Insert into Post" button text when media modal is used for feature images
435 435
 	 */
436
-	public function change_attachment_field_button( $html ) {
437
-		if ( isset( $_GET['feature_image_text_button'] ) ) {
438
-			$html = str_replace( 'value="Insert into Post"', sprintf( 'value="%s"', esc_html__( 'Select featured image', 'lsx-team' ) ), $html );
436
+	public function change_attachment_field_button($html) {
437
+		if (isset($_GET['feature_image_text_button'])) {
438
+			$html = str_replace('value="Insert into Post"', sprintf('value="%s"', esc_html__('Select featured image', 'lsx-team')), $html);
439 439
 		}
440 440
 
441 441
 		return $html;
442 442
 	}
443 443
 
444
-	public function change_title_text( $title ) {
444
+	public function change_title_text($title) {
445 445
 		$screen = get_current_screen();
446 446
 
447
-		if ( 'team' === $screen->post_type ) {
448
-			$title = esc_attr__( 'Enter team member name', 'lsx-team' );
447
+		if ('team' === $screen->post_type) {
448
+			$title = esc_attr__('Enter team member name', 'lsx-team');
449 449
 		}
450 450
 
451 451
 		return $title;
Please login to merge, or discard this patch.
templates/taxonomy-team_role.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 <?php lsx_content_wrap_before(); ?>
11 11
 
12
-<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
12
+<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
13 13
 
14 14
 	<?php lsx_content_before(); ?>
15 15
 
@@ -17,18 +17,18 @@  discard block
 block discarded – undo
17 17
 
18 18
 		<?php lsx_content_top(); ?>
19 19
 
20
-		<?php if ( have_posts() ) : ?>
20
+		<?php if (have_posts()) : ?>
21 21
 
22 22
 			<div class="lsx-team-container">
23 23
 				<div class="row row-flex">
24 24
 
25 25
 					<?php
26
-						while ( have_posts() ) {
26
+						while (have_posts()) {
27 27
 							the_post();
28
-							include( LSX_TEAM_PATH . '/templates/content-archive-team.php' );
28
+							include(LSX_TEAM_PATH.'/templates/content-archive-team.php');
29 29
 						}
30 30
 
31
-						include( LSX_TEAM_PATH . '/templates/content-archive-team-careers-cta.php' );
31
+						include(LSX_TEAM_PATH.'/templates/content-archive-team-careers-cta.php');
32 32
 					?>
33 33
 
34 34
 				</div>
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 		<?php else : ?>
40 40
 
41
-			<?php get_template_part( 'partials/content', 'none' ); ?>
41
+			<?php get_template_part('partials/content', 'none'); ?>
42 42
 
43 43
 		<?php endif; ?>
44 44
 
Please login to merge, or discard this patch.
classes/class-lsx-team-frontend.php 1 patch
Spacing   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -23,36 +23,36 @@  discard block
 block discarded – undo
23 23
 
24 24
 		$this->options = team_get_options();
25 25
 
26
-		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 5 );
27
-		add_filter( 'wp_kses_allowed_html', array( $this, 'wp_kses_allowed_html' ), 10, 2 );
28
-		add_filter( 'template_include', array( $this, 'single_template_include' ), 99 );
29
-		add_filter( 'template_include', array( $this, 'archive_template_include' ), 99 );
26
+		add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'), 5);
27
+		add_filter('wp_kses_allowed_html', array($this, 'wp_kses_allowed_html'), 10, 2);
28
+		add_filter('template_include', array($this, 'single_template_include'), 99);
29
+		add_filter('template_include', array($this, 'archive_template_include'), 99);
30 30
 
31
-		if ( ! empty( $this->options['display']['team_disable_single'] ) ) {
32
-			add_action( 'template_redirect', array( $this, 'disable_single' ) );
31
+		if (!empty($this->options['display']['team_disable_single'])) {
32
+			add_action('template_redirect', array($this, 'disable_single'));
33 33
 		}
34 34
 
35
-		if ( ! empty( $this->options['display']['group_by_role'] ) ) {
36
-			add_action( 'pre_get_posts', array( $this, 'pre_get_posts_order_by_role' ) );
37
-			add_action( 'lsx_entry_before', array( $this, 'entry_before' ) );
35
+		if (!empty($this->options['display']['group_by_role'])) {
36
+			add_action('pre_get_posts', array($this, 'pre_get_posts_order_by_role'));
37
+			add_action('lsx_entry_before', array($this, 'entry_before'));
38 38
 		}
39 39
 
40
-		add_action( 'pre_get_posts', array( $this, 'disable_pagination_on_archive' ) );
40
+		add_action('pre_get_posts', array($this, 'disable_pagination_on_archive'));
41 41
 
42
-		if ( is_admin() ) {
43
-			add_filter( 'lsx_customizer_colour_selectors_body', array( $this, 'customizer_body_colours_handler' ), 15, 2 );
42
+		if (is_admin()) {
43
+			add_filter('lsx_customizer_colour_selectors_body', array($this, 'customizer_body_colours_handler'), 15, 2);
44 44
 		}
45 45
 
46
-		add_filter( 'lsx_fonts_css', array( $this, 'customizer_fonts_handler' ), 15 );
47
-		add_filter( 'lsx_banner_title', array( $this, 'lsx_banner_archive_title' ), 15 );
48
-		add_filter( 'lsx_banner_title', array( $this, 'lsx_banner_single_title' ), 15 );
49
-		add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 );
46
+		add_filter('lsx_fonts_css', array($this, 'customizer_fonts_handler'), 15);
47
+		add_filter('lsx_banner_title', array($this, 'lsx_banner_archive_title'), 15);
48
+		add_filter('lsx_banner_title', array($this, 'lsx_banner_single_title'), 15);
49
+		add_filter('get_the_archive_title', array($this, 'get_the_archive_title'), 100);
50 50
 
51
-		add_filter( 'excerpt_more_p', array( $this, 'change_excerpt_more' ) );
52
-		add_filter( 'excerpt_length', array( $this, 'change_excerpt_length' ) );
53
-		add_filter( 'excerpt_strip_tags', array( $this, 'change_excerpt_strip_tags' ) );
51
+		add_filter('excerpt_more_p', array($this, 'change_excerpt_more'));
52
+		add_filter('excerpt_length', array($this, 'change_excerpt_length'));
53
+		add_filter('excerpt_strip_tags', array($this, 'change_excerpt_strip_tags'));
54 54
 
55
-		add_filter( 'wpseo_schema_graph_pieces', array( $this, 'add_graph_pieces' ), 11, 2 );
55
+		add_filter('wpseo_schema_graph_pieces', array($this, 'add_graph_pieces'), 11, 2);
56 56
 	}
57 57
 
58 58
 	/**
@@ -64,36 +64,36 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public static function get_instance() {
66 66
 		// If the single instance hasn't been set, set it now.
67
-		if ( null === self::$instance ) {
67
+		if (null === self::$instance) {
68 68
 			self::$instance = new self();
69 69
 		}
70 70
 		return self::$instance;
71 71
 	}
72 72
 
73
-	public function enqueue_scripts( $plugins ) {
74
-		$has_slick = wp_script_is( 'slick', 'queue' );
73
+	public function enqueue_scripts($plugins) {
74
+		$has_slick = wp_script_is('slick', 'queue');
75 75
 
76
-		if ( ! $has_slick ) {
77
-			wp_enqueue_style( 'slick', LSX_TEAM_URL . 'assets/css/vendor/slick.css', array(), LSX_TEAM_VER, null );
78
-			wp_enqueue_script( 'slick', LSX_TEAM_URL . 'assets/js/vendor/slick.min.js', array( 'jquery' ), null, LSX_TEAM_VER, true );
76
+		if (!$has_slick) {
77
+			wp_enqueue_style('slick', LSX_TEAM_URL.'assets/css/vendor/slick.css', array(), LSX_TEAM_VER, null);
78
+			wp_enqueue_script('slick', LSX_TEAM_URL.'assets/js/vendor/slick.min.js', array('jquery'), null, LSX_TEAM_VER, true);
79 79
 		}
80 80
 
81
-		wp_enqueue_script( 'lsx-team', LSX_TEAM_URL . 'assets/js/lsx-team.min.js', array( 'jquery', 'slick' ), LSX_TEAM_VER, true );
81
+		wp_enqueue_script('lsx-team', LSX_TEAM_URL.'assets/js/lsx-team.min.js', array('jquery', 'slick'), LSX_TEAM_VER, true);
82 82
 
83
-		$params = apply_filters( 'lsx_team_js_params', array(
84
-			'ajax_url' => admin_url( 'admin-ajax.php' ),
83
+		$params = apply_filters('lsx_team_js_params', array(
84
+			'ajax_url' => admin_url('admin-ajax.php'),
85 85
 		));
86 86
 
87
-		wp_localize_script( 'lsx-team', 'lsx_team_params', $params );
87
+		wp_localize_script('lsx-team', 'lsx_team_params', $params);
88 88
 
89
-		wp_enqueue_style( 'lsx-team', LSX_TEAM_URL . 'assets/css/lsx-team.css', array(), LSX_TEAM_VER );
90
-		wp_style_add_data( 'lsx-team', 'rtl', 'replace' );
89
+		wp_enqueue_style('lsx-team', LSX_TEAM_URL.'assets/css/lsx-team.css', array(), LSX_TEAM_VER);
90
+		wp_style_add_data('lsx-team', 'rtl', 'replace');
91 91
 	}
92 92
 
93 93
 	/**
94 94
 	 * Allow data params for Slick slider addon.
95 95
 	 */
96
-	public function wp_kses_allowed_html( $allowedtags, $context ) {
96
+	public function wp_kses_allowed_html($allowedtags, $context) {
97 97
 		$allowedtags['div']['data-slick'] = true;
98 98
 		return $allowedtags;
99 99
 	}
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
 	/**
102 102
 	 * Single template.
103 103
 	 */
104
-	public function single_template_include( $template ) {
105
-		if ( is_main_query() && is_singular( 'team' ) ) {
106
-			if ( empty( locate_template( array( 'single-team.php' ) ) ) && file_exists( LSX_TEAM_PATH . 'templates/single-team.php' ) ) {
107
-				$template = LSX_TEAM_PATH . 'templates/single-team.php';
104
+	public function single_template_include($template) {
105
+		if (is_main_query() && is_singular('team')) {
106
+			if (empty(locate_template(array('single-team.php'))) && file_exists(LSX_TEAM_PATH.'templates/single-team.php')) {
107
+				$template = LSX_TEAM_PATH.'templates/single-team.php';
108 108
 			}
109 109
 		}
110 110
 
@@ -114,16 +114,16 @@  discard block
 block discarded – undo
114 114
 	/**
115 115
 	 * Archive template.
116 116
 	 */
117
-	public function archive_template_include( $template ) {
118
-		if ( is_main_query() && is_post_type_archive( 'team' ) ) {
119
-			if ( empty( locate_template( array( 'archive-team.php' ) ) ) && file_exists( LSX_TEAM_PATH . 'templates/archive-team.php' ) ) {
120
-				$template = LSX_TEAM_PATH . 'templates/archive-team.php';
117
+	public function archive_template_include($template) {
118
+		if (is_main_query() && is_post_type_archive('team')) {
119
+			if (empty(locate_template(array('archive-team.php'))) && file_exists(LSX_TEAM_PATH.'templates/archive-team.php')) {
120
+				$template = LSX_TEAM_PATH.'templates/archive-team.php';
121 121
 			}
122 122
 		}
123 123
 
124
-		if ( is_tax( 'team_role' ) ) {
125
-			if ( empty( locate_template( array( 'taxonomy-team_role.php' ) ) ) && file_exists( LSX_TEAM_PATH . 'templates/taxonomy-team_role.php' ) ) {
126
-				$template = LSX_TEAM_PATH . 'templates/taxonomy-team_role.php';
124
+		if (is_tax('team_role')) {
125
+			if (empty(locate_template(array('taxonomy-team_role.php'))) && file_exists(LSX_TEAM_PATH.'templates/taxonomy-team_role.php')) {
126
+				$template = LSX_TEAM_PATH.'templates/taxonomy-team_role.php';
127 127
 			}
128 128
 		}
129 129
 
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
 	 * Removes access to single team member posts.
135 135
 	 */
136 136
 	public function disable_single() {
137
-		$queried_post_type = get_query_var( 'post_type' );
137
+		$queried_post_type = get_query_var('post_type');
138 138
 
139
-		if ( is_single() && 'team' === $queried_post_type ) {
140
-			wp_redirect( home_url(), 301 );
139
+		if (is_single() && 'team' === $queried_post_type) {
140
+			wp_redirect(home_url(), 301);
141 141
 			exit;
142 142
 		}
143 143
 	}
@@ -145,29 +145,29 @@  discard block
 block discarded – undo
145 145
 	/**
146 146
 	 * Disable pagination.
147 147
 	 */
148
-	public function disable_pagination_on_archive( $query ) {
149
-		if ( $query->is_main_query() && $query->is_post_type_archive( 'team' ) ) {
150
-			$query->set( 'posts_per_page', -1 );
151
-			$query->set( 'no_found_rows', true );
148
+	public function disable_pagination_on_archive($query) {
149
+		if ($query->is_main_query() && $query->is_post_type_archive('team')) {
150
+			$query->set('posts_per_page', -1);
151
+			$query->set('no_found_rows', true);
152 152
 		}
153 153
 	}
154 154
 
155 155
 	/**
156 156
 	 * Handle fonts that might be change by LSX Customiser.
157 157
 	 */
158
-	public function customizer_fonts_handler( $css_fonts ) {
158
+	public function customizer_fonts_handler($css_fonts) {
159 159
 		global $wp_filesystem;
160 160
 
161
-		$css_fonts_file = LSX_TEAM_PATH . '/assets/css/lsx-team-fonts.css';
161
+		$css_fonts_file = LSX_TEAM_PATH.'/assets/css/lsx-team-fonts.css';
162 162
 
163
-		if ( file_exists( $css_fonts_file ) ) {
164
-			if ( empty( $wp_filesystem ) ) {
165
-				require_once( ABSPATH . 'wp-admin/includes/file.php' );
163
+		if (file_exists($css_fonts_file)) {
164
+			if (empty($wp_filesystem)) {
165
+				require_once(ABSPATH.'wp-admin/includes/file.php');
166 166
 				WP_Filesystem();
167 167
 			}
168 168
 
169
-			if ( $wp_filesystem ) {
170
-				$css_fonts .= $wp_filesystem->get_contents( $css_fonts_file );
169
+			if ($wp_filesystem) {
170
+				$css_fonts .= $wp_filesystem->get_contents($css_fonts_file);
171 171
 			}
172 172
 		}
173 173
 
@@ -177,20 +177,20 @@  discard block
 block discarded – undo
177 177
 	/**
178 178
 	 * Handle body colours that might be change by LSX Customiser.
179 179
 	 */
180
-	public function customizer_body_colours_handler( $css, $colors ) {
180
+	public function customizer_body_colours_handler($css, $colors) {
181 181
 		$css .= '
182
-			@import "' . LSX_TEAM_PATH . '/assets/css/scss/customizer-team-body-colours";
182
+			@import "' . LSX_TEAM_PATH.'/assets/css/scss/customizer-team-body-colours";
183 183
 
184 184
 			/**
185 185
 			 * LSX Customizer - Body (LSX Team)
186 186
 			 */
187 187
 			@include customizer-team-body-colours (
188
-				$bg:   		' . $colors['background_color'] . ',
189
-				$breaker:   ' . $colors['body_line_color'] . ',
190
-				$color:    	' . $colors['body_text_color'] . ',
191
-				$link:    	' . $colors['body_link_color'] . ',
192
-				$hover:    	' . $colors['body_link_hover_color'] . ',
193
-				$small:    	' . $colors['body_text_small_color'] . '
188
+				$bg:   		' . $colors['background_color'].',
189
+				$breaker:   ' . $colors['body_line_color'].',
190
+				$color:    	' . $colors['body_text_color'].',
191
+				$link:    	' . $colors['body_link_color'].',
192
+				$hover:    	' . $colors['body_link_hover_color'].',
193
+				$small:    	' . $colors['body_text_small_color'].'
194 194
 			);
195 195
 		';
196 196
 
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 	/**
201 201
 	 * Change the LSX Banners title for team archive.
202 202
 	 */
203
-	public function lsx_banner_archive_title( $title ) {
204
-		if ( is_main_query() && is_post_type_archive( 'team' ) ) {
205
-			$title = '<h1 class="page-title">' . esc_html__( 'Team', 'lsx-team' ) . '</h1>';
203
+	public function lsx_banner_archive_title($title) {
204
+		if (is_main_query() && is_post_type_archive('team')) {
205
+			$title = '<h1 class="page-title">'.esc_html__('Team', 'lsx-team').'</h1>';
206 206
 		}
207 207
 
208 208
 		return $title;
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
 	/**
212 212
 	 * Change the LSX Banners title for team single.
213 213
 	 */
214
-	public function lsx_banner_single_title( $title ) {
215
-		if ( is_main_query() && is_singular( 'team' ) ) {
216
-			$title = '<h1 class="page-title">' . esc_html__( 'Team', 'lsx-team' ) . '</h1>';
214
+	public function lsx_banner_single_title($title) {
215
+		if (is_main_query() && is_singular('team')) {
216
+			$title = '<h1 class="page-title">'.esc_html__('Team', 'lsx-team').'</h1>';
217 217
 		}
218 218
 
219 219
 		return $title;
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
 	 * @param string $title the term title.
226 226
 	 * @return string
227 227
 	 */
228
-	public function get_the_archive_title( $title ) {
229
-		if ( is_post_type_archive( 'team' ) ) {
230
-			$title = __( 'Team', 'lsx-health-plan' );
228
+	public function get_the_archive_title($title) {
229
+		if (is_post_type_archive('team')) {
230
+			$title = __('Team', 'lsx-health-plan');
231 231
 		}
232 232
 		return $title;
233 233
 	}
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 	/**
236 236
 	 * Remove the "continue reading" when the single is disabled.
237 237
 	 */
238
-	public function change_excerpt_more( $excerpt_more ) {
238
+	public function change_excerpt_more($excerpt_more) {
239 239
 		global $post;
240 240
 
241
-		if ( 'team' === $post->post_type ) {
242
-			if ( ! empty( team_get_option( 'team_disable_single' ) ) ) {
241
+		if ('team' === $post->post_type) {
242
+			if (!empty(team_get_option('team_disable_single'))) {
243 243
 				$excerpt_more = '';
244 244
 			}
245 245
 		}
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
 	/**
251 251
 	 * Change the word count when crop the content to excerpt (single team relations).
252 252
 	 */
253
-	public function change_excerpt_length( $excerpt_word_count ) {
253
+	public function change_excerpt_length($excerpt_word_count) {
254 254
 		global $post;
255 255
 
256
-		if ( is_singular( 'team' ) && ( 'project' === $post->post_type || 'testimonial' === $post->post_type ) ) {
256
+		if (is_singular('team') && ('project' === $post->post_type || 'testimonial' === $post->post_type)) {
257 257
 			$excerpt_word_count = 20;
258 258
 		}
259 259
 
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
 	/**
264 264
 	 * Change the allowed tags crop the content to excerpt (single team relations).
265 265
 	 */
266
-	public function change_excerpt_strip_tags( $allowed_tags ) {
266
+	public function change_excerpt_strip_tags($allowed_tags) {
267 267
 		global $post;
268 268
 
269
-		if ( is_singular( 'team' ) && ( 'project' === $post->post_type || 'testimonial' === $post->post_type ) ) {
269
+		if (is_singular('team') && ('project' === $post->post_type || 'testimonial' === $post->post_type)) {
270 270
 			$allowed_tags = '<p>,<br>,<b>,<strong>,<i>,<u>,<ul>,<ol>,<li>,<span>';
271 271
 		}
272 272
 
@@ -278,12 +278,12 @@  discard block
 block discarded – undo
278 278
 	 *
279 279
 	 * @return mixed
280 280
 	 */
281
-	public function pre_get_posts_order_by_role( $query ) {
282
-		if ( ! is_admin() && $query->is_main_query() && $query->is_post_type_archive( 'team' ) ) {
281
+	public function pre_get_posts_order_by_role($query) {
282
+		if (!is_admin() && $query->is_main_query() && $query->is_post_type_archive('team')) {
283 283
 			$post_ids = $this->order_by_role_query();
284
-			if ( ! empty( $post_ids ) ) {
285
-				$query->set( 'post__in', $post_ids );
286
-				$query->set( 'orderby', 'post__in' );
284
+			if (!empty($post_ids)) {
285
+				$query->set('post__in', $post_ids);
286
+				$query->set('orderby', 'post__in');
287 287
 			}
288 288
 		}
289 289
 		return $query;
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 		global $wpdb;
297 297
 		$post_ids = array();
298 298
 
299
-		$results = $wpdb->get_results( $wpdb->prepare("
299
+		$results = $wpdb->get_results($wpdb->prepare("
300 300
 			SELECT posts.ID, posts.post_title, terms.slug
301 301
 			FROM {$wpdb->posts} AS posts
302 302
 			INNER JOIN {$wpdb->term_relationships} as rels
@@ -309,10 +309,10 @@  discard block
 block discarded – undo
309 309
 			AND tax.taxonomy = '%s'
310 310
 			AND tax.term_id = terms.term_id
311 311
 			ORDER BY terms.lsx_team_term_order, posts.post_name
312
-         ", 'team', 'publish', 'team_role' ) );
312
+         ", 'team', 'publish', 'team_role'));
313 313
 
314
-		if ( ! empty( $results ) ) {
315
-			$post_ids = wp_list_pluck( $results, 'ID' );
314
+		if (!empty($results)) {
315
+			$post_ids = wp_list_pluck($results, 'ID');
316 316
 		}
317 317
 		return $post_ids;
318 318
 	}
@@ -322,17 +322,17 @@  discard block
 block discarded – undo
322 322
 	 * Outputs the Role Title if its found
323 323
 	 */
324 324
 	public function entry_before() {
325
-		if ( is_post_type_archive( 'team' ) ) {
326
-			$all_roles    = wc_get_object_terms( get_the_ID(), 'team_role' );
325
+		if (is_post_type_archive('team')) {
326
+			$all_roles    = wc_get_object_terms(get_the_ID(), 'team_role');
327 327
 			$this_role    = '';
328 328
 			$this_role_id = '';
329
-			if ( ! empty( $all_roles ) ) {
329
+			if (!empty($all_roles)) {
330 330
 				$this_role    = $all_roles[0];
331 331
 				$this_role_id = $this_role->term_id;
332 332
 			}
333 333
 
334
-			if ( '' === $this->previous_role || $this->previous_role !== $this_role_id ) {
335
-				echo '<h2 class="role-title text-center col-xs-12 col-sm-12 col-md-12">' . wp_kses_post( $this_role->name ) . '</h2>';
334
+			if ('' === $this->previous_role || $this->previous_role !== $this_role_id) {
335
+				echo '<h2 class="role-title text-center col-xs-12 col-sm-12 col-md-12">'.wp_kses_post($this_role->name).'</h2>';
336 336
 				$this->previous_role = $this_role_id;
337 337
 			}
338 338
 		}
@@ -340,11 +340,11 @@  discard block
 block discarded – undo
340 340
 	/**
341 341
 	 * Adds Pieces
342 342
 	 */
343
-	public function add_graph_pieces( $pieces, $context ) {
343
+	public function add_graph_pieces($pieces, $context) {
344 344
 		// Scheme Class.
345
-		if ( class_exists( 'LSX_Schema_Graph_Piece' ) ) {
346
-			require_once LSX_TEAM_PATH . '/classes/class-lsx-team-schema.php';
347
-			$pieces[] = new \LSX_Team_Schema( $context );
345
+		if (class_exists('LSX_Schema_Graph_Piece')) {
346
+			require_once LSX_TEAM_PATH.'/classes/class-lsx-team-schema.php';
347
+			$pieces[] = new \LSX_Team_Schema($context);
348 348
 		}
349 349
 		return $pieces;
350 350
 	}
Please login to merge, or discard this patch.
classes/class-lsx-team.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -15,23 +15,23 @@  discard block
 block discarded – undo
15 15
 	public function __construct() {
16 16
 		$this->options = team_get_options();
17 17
 
18
-		add_action( 'init', array( $this, 'custom_image_sizes' ) );
19
-		add_filter( 'lsx_banner_allowed_post_types', array( $this, 'lsx_banner_allowed_post_types' ) );
18
+		add_action('init', array($this, 'custom_image_sizes'));
19
+		add_filter('lsx_banner_allowed_post_types', array($this, 'lsx_banner_allowed_post_types'));
20 20
 
21 21
 	}
22 22
 
23 23
 	/**
24 24
 	 * Enable project custom post type on LSX Banners.
25 25
 	 */
26
-	public function custom_image_sizes( $post_types ) {
27
-		add_image_size( 'lsx-team-archive', 170, 170, true );
28
-		add_image_size( 'lsx-team-single', 320, 320, true );
26
+	public function custom_image_sizes($post_types) {
27
+		add_image_size('lsx-team-archive', 170, 170, true);
28
+		add_image_size('lsx-team-single', 320, 320, true);
29 29
 	}
30 30
 
31 31
 	/**
32 32
 	 * Enable project custom post type on LSX Banners.
33 33
 	 */
34
-	public function lsx_banner_allowed_post_types( $post_types ) {
34
+	public function lsx_banner_allowed_post_types($post_types) {
35 35
 		$post_types[] = 'team';
36 36
 		return $post_types;
37 37
 	}
@@ -39,39 +39,39 @@  discard block
 block discarded – undo
39 39
 	/**
40 40
 	 * Return the team thumbnail.
41 41
 	 */
42
-	public function get_thumbnail( $post_id, $size ) {
43
-		add_filter( 'lsx_placeholder_url', array( $this, 'placeholder' ), 10, 1 );
44
-		add_filter( 'lsx_to_placeholder_url', array( $this, 'placeholder' ), 10, 1 );
42
+	public function get_thumbnail($post_id, $size) {
43
+		add_filter('lsx_placeholder_url', array($this, 'placeholder'), 10, 1);
44
+		add_filter('lsx_to_placeholder_url', array($this, 'placeholder'), 10, 1);
45 45
 
46
-		if ( is_numeric( $size ) ) {
47
-			$thumb_size = array( $size, $size );
46
+		if (is_numeric($size)) {
47
+			$thumb_size = array($size, $size);
48 48
 		} else {
49 49
 			$thumb_size = $size;
50 50
 		}
51 51
 
52 52
 		$thumbnail_class = 'img-responsive';
53 53
 
54
-		if ( ! empty( get_the_post_thumbnail( $post_id ) ) || ! empty( get_post_meta( $post_id, 'lsx_email_gravatar', true ) ) ) {
55
-			if ( ! empty( get_the_post_thumbnail( $post_id ) ) ) {
56
-				$thumbnail = get_the_post_thumbnail( $post_id, $thumb_size, array(
54
+		if (!empty(get_the_post_thumbnail($post_id)) || !empty(get_post_meta($post_id, 'lsx_email_gravatar', true))) {
55
+			if (!empty(get_the_post_thumbnail($post_id))) {
56
+				$thumbnail = get_the_post_thumbnail($post_id, $thumb_size, array(
57 57
 					'class' => $thumbnail_class,
58
-				) );
58
+				));
59 59
 			} else {
60
-				$thumbnail = get_avatar( get_post_meta( $post_id, 'lsx_email_gravatar', true ), $size, $this->options['display']['team_placeholder'], false, array(
60
+				$thumbnail = get_avatar(get_post_meta($post_id, 'lsx_email_gravatar', true), $size, $this->options['display']['team_placeholder'], false, array(
61 61
 					'class' => $thumbnail_class,
62
-				) );
62
+				));
63 63
 			}
64 64
 		}
65
-		if ( empty( $thumbnail ) ) {
66
-			if ( $this->options['display'] && ! empty( $this->options['display']['team_placeholder'] ) ) {
67
-				$thumbnail = '<img loading="lazy" class="img-responsive wp-post-image" src="' . $this->options['display']['team_placeholder'] . '" width="' . $size . '" />';
65
+		if (empty($thumbnail)) {
66
+			if ($this->options['display'] && !empty($this->options['display']['team_placeholder'])) {
67
+				$thumbnail = '<img loading="lazy" class="img-responsive wp-post-image" src="'.$this->options['display']['team_placeholder'].'" width="'.$size.'" />';
68 68
 			} else {
69
-				$thumbnail = '<img loading="lazy" class="img-responsive wp-post-image" src="https://www.gravatar.com/avatar/none?d=mm&s=' . $size . '" width="' . $size . '" />';
69
+				$thumbnail = '<img loading="lazy" class="img-responsive wp-post-image" src="https://www.gravatar.com/avatar/none?d=mm&s='.$size.'" width="'.$size.'" />';
70 70
 			}
71 71
 		}
72 72
 
73
-		remove_filter( 'lsx_placeholder_url', array( $this, 'placeholder' ), 10, 1 );
74
-		remove_filter( 'lsx_to_placeholder_url', array( $this, 'placeholder' ), 10, 1 );
73
+		remove_filter('lsx_placeholder_url', array($this, 'placeholder'), 10, 1);
74
+		remove_filter('lsx_to_placeholder_url', array($this, 'placeholder'), 10, 1);
75 75
 
76 76
 		return $thumbnail;
77 77
 	}
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 	/**
80 80
 	 * Replaces the widget with Mystery Man
81 81
 	 */
82
-	public function placeholder( $image ) {
82
+	public function placeholder($image) {
83 83
 		$image = array(
84
-			LSX_TEAM_URL . 'assets/img/mystery-man-square.png',
84
+			LSX_TEAM_URL.'assets/img/mystery-man-square.png',
85 85
 			512,
86 86
 			512,
87 87
 			true,
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 	/**
94 94
 	 * Returns the shortcode output markup
95 95
 	 */
96
-	public function output( $atts ) {
97
-		extract( shortcode_atts(array(
96
+	public function output($atts) {
97
+		extract(shortcode_atts(array(
98 98
 			'columns' => 4,
99 99
 			'orderby' => 'name',
100 100
 			'order' => 'ASC',
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
 			'show_social' => true,
113 113
 			'carousel' => true,
114 114
 			'featured' => false,
115
-		), $atts ) );
115
+		), $atts));
116 116
 
117 117
 		$output = '';
118 118
 
119
-		if ( ! empty( $include ) ) {
120
-			$include = explode( ',', $include );
119
+		if (!empty($include)) {
120
+			$include = explode(',', $include);
121 121
 
122 122
 			$args = array(
123 123
 				'post_type' => 'team',
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
 				'order' => $order,
135 135
 			);
136 136
 
137
-			if ( 'true' === $featured || true === $featured ) {
137
+			if ('true' === $featured || true === $featured) {
138 138
 				$args['meta_key'] = 'lsx_featured';
139 139
 				$args['meta_value'] = 1;
140 140
 			}
141 141
 		}
142 142
 
143
-		if ( ! empty( $role ) ) {
143
+		if (!empty($role)) {
144 144
 			$args['tax_query'] = array(
145 145
 				array(
146 146
 					'taxonomy' => 'team_role',
@@ -150,32 +150,32 @@  discard block
 block discarded – undo
150 150
 			);
151 151
 		}
152 152
 
153
-		$team = new \WP_Query( $args );
153
+		$team = new \WP_Query($args);
154 154
 
155
-		if ( $team->have_posts() ) {
155
+		if ($team->have_posts()) {
156 156
 			global $post;
157 157
 
158 158
 			$count = 0;
159 159
 			$count_global = 0;
160 160
 
161
-			$column_size = intval( 12 / $columns );
161
+			$column_size = intval(12 / $columns);
162 162
 
163 163
 			$carousel = true === $carousel || 'true' === $carousel ? true : false;
164 164
 
165
-			if ( $carousel ) {
165
+			if ($carousel) {
166 166
 				$output .= "<div class='lsx-team-shortcode lsx-team-block' id='lsx-team-slider' data-slick='{\"slidesToShow\": $columns, \"slidesToScroll\": $columns }'>";
167 167
 			} else {
168 168
 				$output .= "<div class='lsx-team-shortcode'><div class='row'>";
169 169
 			}
170 170
 
171
-			while ( $team->have_posts() ) {
171
+			while ($team->have_posts()) {
172 172
 				$team->the_post();
173 173
 
174 174
 				// Count
175 175
 				$count++;
176 176
 				$count_global++;
177 177
 
178
-				$member_name = apply_filters( 'the_title', $post->post_title );
178
+				$member_name = apply_filters('the_title', $post->post_title);
179 179
 				$member_roles = '';
180 180
 				$member_description = '';
181 181
 				$member_avatar = '';
@@ -183,91 +183,91 @@  discard block
 block discarded – undo
183 183
 				$member_job_title = '';
184 184
 				$member_email = '';
185 185
 				$bottom_link = '';
186
-				$facebook = get_post_meta( $post->ID, 'lsx_facebook', true );
187
-				$twitter = get_post_meta( $post->ID, 'lsx_twitter', true );
188
-				$linkedin = get_post_meta( $post->ID, 'lsx_linkedin', true );
186
+				$facebook = get_post_meta($post->ID, 'lsx_facebook', true);
187
+				$twitter = get_post_meta($post->ID, 'lsx_twitter', true);
188
+				$linkedin = get_post_meta($post->ID, 'lsx_linkedin', true);
189 189
 
190 190
 				// Link to single
191
-				if ( ( true === $show_link || 'true' === $show_link ) && ( empty( team_get_option( 'team_disable_single' ) ) ) ) {
192
-					$bottom_link = '<a href="' . get_permalink( $post->ID ) . '" class="lsx-team-show-more">More about ' . strtok( $member_name, ' ' ) . '<i class="fa fa-long-arrow-right" aria-hidden="true"></i></a>';
191
+				if ((true === $show_link || 'true' === $show_link) && (empty(team_get_option('team_disable_single')))) {
192
+					$bottom_link = '<a href="'.get_permalink($post->ID).'" class="lsx-team-show-more">More about '.strtok($member_name, ' ').'<i class="fa fa-long-arrow-right" aria-hidden="true"></i></a>';
193 193
 				}
194 194
 
195
-				if ( true === $show_email || 'true' === $show_email ) {
196
-					$email = get_post_meta( $post->ID, 'lsx_email_contact', true );
195
+				if (true === $show_email || 'true' === $show_email) {
196
+					$email = get_post_meta($post->ID, 'lsx_email_contact', true);
197 197
 
198
-					$member_email = '<a href="mailto:' . sanitize_email( $email ) . '" class="lsx-team-email">' . sanitize_email( $email ) . '</a>';
198
+					$member_email = '<a href="mailto:'.sanitize_email($email).'" class="lsx-team-email">'.sanitize_email($email).'</a>';
199 199
 				}
200 200
 
201
-				if ( ( true === $show_link || 'true' === $show_link ) && ( empty( team_get_option( 'team_disable_single' ) ) ) ) {
202
-					$member_name = '<h5 class="lsx-team-name"><a href="' . get_permalink() . '">' . $member_name . '</a></h5>';
201
+				if ((true === $show_link || 'true' === $show_link) && (empty(team_get_option('team_disable_single')))) {
202
+					$member_name = '<h5 class="lsx-team-name"><a href="'.get_permalink().'">'.$member_name.'</a></h5>';
203 203
 				} else {
204
-					$member_name = '<h5 class="lsx-team-name">' . $member_name . '</h5>';
204
+					$member_name = '<h5 class="lsx-team-name">'.$member_name.'</h5>';
205 205
 				}
206 206
 
207 207
 				// Member roles
208
-				if ( true === $show_roles || 'true' === $show_roles ) {
208
+				if (true === $show_roles || 'true' === $show_roles) {
209 209
 					$roles = '';
210
-					$terms = get_the_terms( $post->ID, 'team_role' );
210
+					$terms = get_the_terms($post->ID, 'team_role');
211 211
 
212
-					if ( $terms && ! is_wp_error( $terms ) ) {
212
+					if ($terms && !is_wp_error($terms)) {
213 213
 						$roles = array();
214 214
 
215
-						foreach ( $terms as $term ) {
215
+						foreach ($terms as $term) {
216 216
 							$roles[] = $term->name;
217 217
 						}
218 218
 
219
-						$roles = join( ', ', $roles );
219
+						$roles = join(', ', $roles);
220 220
 					}
221 221
 
222 222
 					$member_roles = '' !== $roles ? "<small class='lsx-team-roles'>$roles</small>" : '';
223 223
 				}
224 224
 
225
-				if ( true === $show_job_title || 'true' === $show_job_title ) {
226
-					$job_title = get_post_meta( $post->ID, 'lsx_job_title', true );
227
-					$member_job_title = ! empty( $job_title ) ? "<small class='lsx-team-job-title'>$job_title</small>" : '';
225
+				if (true === $show_job_title || 'true' === $show_job_title) {
226
+					$job_title = get_post_meta($post->ID, 'lsx_job_title', true);
227
+					$member_job_title = !empty($job_title) ? "<small class='lsx-team-job-title'>$job_title</small>" : '';
228 228
 				}
229 229
 
230 230
 				// Member description
231
-				if ( true === $show_desc || 'true' === $show_desc ) {
232
-					if ( 'full' === $display ) {
233
-						$member_description = apply_filters( 'the_content', get_the_content( esc_html__( 'Read More', 'lsx-team' ) ) );
234
-						$member_description = str_replace( ']]>', ']]&gt;', $member_description );
235
-					} elseif ( 'excerpt' === $display ) {
236
-						$member_description = apply_filters( 'the_excerpt', get_the_excerpt() );
231
+				if (true === $show_desc || 'true' === $show_desc) {
232
+					if ('full' === $display) {
233
+						$member_description = apply_filters('the_content', get_the_content(esc_html__('Read More', 'lsx-team')));
234
+						$member_description = str_replace(']]>', ']]&gt;', $member_description);
235
+					} elseif ('excerpt' === $display) {
236
+						$member_description = apply_filters('the_excerpt', get_the_excerpt());
237 237
 					}
238 238
 
239
-					$member_description = ! empty( $member_description ) ? "<div class='lsx-team-description'>$member_description</div>" : '';
239
+					$member_description = !empty($member_description) ? "<div class='lsx-team-description'>$member_description</div>" : '';
240 240
 				}
241 241
 
242 242
 				// Member avatar
243
-				if ( true === $show_image || 'true' === $show_image ) {
244
-					$member_avatar = $this->get_thumbnail( $post->ID, $size );
243
+				if (true === $show_image || 'true' === $show_image) {
244
+					$member_avatar = $this->get_thumbnail($post->ID, $size);
245 245
 
246
-					if ( ( true === $show_link || 'true' === $show_link ) && ( empty( $this->options['display'] ) || empty( team_get_option( 'team_disable_single' ) ) ) ) {
247
-						$member_avatar = "<figure class='lsx-team-avatar'><a href='" . get_permalink() . "'>$member_avatar</a></figure>";
246
+					if ((true === $show_link || 'true' === $show_link) && (empty($this->options['display']) || empty(team_get_option('team_disable_single')))) {
247
+						$member_avatar = "<figure class='lsx-team-avatar'><a href='".get_permalink()."'>$member_avatar</a></figure>";
248 248
 					} else {
249 249
 						$member_avatar = "<figure class='lsx-team-avatar'>$member_avatar</figure>";
250 250
 					}
251 251
 				}
252 252
 
253 253
 				// Member socials
254
-				if ( true === $show_social || 'true' === $show_social ) {
254
+				if (true === $show_social || 'true' === $show_social) {
255 255
 					$links = array(
256 256
 						'facebook' => $facebook,
257 257
 						'twitter' => $twitter,
258 258
 						'linkedin' => $linkedin,
259 259
 					);
260 260
 
261
-					foreach ( $links as $sm => $sm_link ) {
262
-						if ( ! empty( $sm_link ) ) {
261
+					foreach ($links as $sm => $sm_link) {
262
+						if (!empty($sm_link)) {
263 263
 							$member_socials .= "<li><a href='$sm_link' target='_blank'><i class='fa fa-$sm' aria-hidden='true'></i></a></li>";
264 264
 						}
265 265
 					}
266 266
 
267
-					$member_socials = ! empty( $member_socials ) ? "<ul class='lsx-team-socials list-inline'>$member_socials</ul>" : '';
267
+					$member_socials = !empty($member_socials) ? "<ul class='lsx-team-socials list-inline'>$member_socials</ul>" : '';
268 268
 				}
269 269
 
270
-				if ( ! $carousel ) {
270
+				if (!$carousel) {
271 271
 					$output .= "<div class='col-xs-12 col-md-$column_size'>";
272 272
 				}
273 273
 
@@ -284,10 +284,10 @@  discard block
 block discarded – undo
284 284
 					</div>
285 285
 				";
286 286
 
287
-				if ( ! $carousel ) {
287
+				if (!$carousel) {
288 288
 					$output .= '</div>';
289 289
 
290
-					if ( $count == $columns && $team->post_count > $count_global ) {
290
+					if ($count == $columns && $team->post_count > $count_global) {
291 291
 						$output .= '</div>';
292 292
 						$output .= '<div class="row">';
293 293
 						$count = 0;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 				wp_reset_postdata();
298 298
 			}
299 299
 
300
-			if ( ! $carousel ) {
300
+			if (!$carousel) {
301 301
 				$output .= '</div>';
302 302
 			}
303 303
 
Please login to merge, or discard this patch.
templates/content-single-team.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -7,34 +7,34 @@  discard block
 block discarded – undo
7 7
 <?php
8 8
 	global $lsx_team;
9 9
 
10
-	$thumbnail = $lsx_team->get_thumbnail( get_the_ID(), 'lsx-team-single' );
10
+	$thumbnail = $lsx_team->get_thumbnail(get_the_ID(), 'lsx-team-single');
11 11
 
12
-	$job_title = get_post_meta( get_the_ID(), 'lsx_job_title', true );
12
+	$job_title = get_post_meta(get_the_ID(), 'lsx_job_title', true);
13 13
 
14 14
 	$links = array(
15
-		'facebook'  => get_post_meta( get_the_ID(), 'lsx_facebook', true ),
16
-		'twitter'   => get_post_meta( get_the_ID(), 'lsx_twitter', true ),
17
-		'linkedin'  => get_post_meta( get_the_ID(), 'lsx_linkedin', true ),
18
-		'github'    => get_post_meta( get_the_ID(), 'lsx_github', true ),
19
-		'wordpress' => get_post_meta( get_the_ID(), 'lsx_wordpress', true ),
15
+		'facebook'  => get_post_meta(get_the_ID(), 'lsx_facebook', true),
16
+		'twitter'   => get_post_meta(get_the_ID(), 'lsx_twitter', true),
17
+		'linkedin'  => get_post_meta(get_the_ID(), 'lsx_linkedin', true),
18
+		'github'    => get_post_meta(get_the_ID(), 'lsx_github', true),
19
+		'wordpress' => get_post_meta(get_the_ID(), 'lsx_wordpress', true),
20 20
 	);
21 21
 
22
-	foreach ( $links as $service => $link ) {
23
-		if ( empty( $link ) ) {
24
-			unset( $links[ $service ] );
22
+	foreach ($links as $service => $link) {
23
+		if (empty($link)) {
24
+			unset($links[$service]);
25 25
 		}
26 26
 	}
27 27
 
28
-	$email = get_post_meta( get_the_ID(), 'lsx_email_contact', true );
29
-	$phone = get_post_meta( get_the_ID(), 'lsx_tel', true );
30
-	$skype = get_post_meta( get_the_ID(), 'lsx_skype', true );
28
+	$email = get_post_meta(get_the_ID(), 'lsx_email_contact', true);
29
+	$phone = get_post_meta(get_the_ID(), 'lsx_tel', true);
30
+	$skype = get_post_meta(get_the_ID(), 'lsx_skype', true);
31 31
 
32 32
 	$phone_attr = $phone;
33
-	$phone_attr = str_replace( ' ', '', $phone_attr );
34
-	$phone_attr = str_replace( '+', '', $phone_attr );
35
-	$phone_attr = str_replace( '(', '', $phone_attr );
36
-	$phone_attr = str_replace( ')', '', $phone_attr );
37
-	$phone_attr = str_replace( '.', '', $phone_attr );
33
+	$phone_attr = str_replace(' ', '', $phone_attr);
34
+	$phone_attr = str_replace('+', '', $phone_attr);
35
+	$phone_attr = str_replace('(', '', $phone_attr);
36
+	$phone_attr = str_replace(')', '', $phone_attr);
37
+	$phone_attr = str_replace('.', '', $phone_attr);
38 38
 
39 39
 	// Tabs
40 40
 
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
 	// Tab Posts
44 44
 
45
-	$site_user = get_post_meta( get_the_ID(), 'lsx_site_user', true );
45
+	$site_user = get_post_meta(get_the_ID(), 'lsx_site_user', true);
46 46
 
47
-	if ( ! empty( $site_user ) ) {
48
-		if ( is_user_member_of_blog( $site_user ) ) {
49
-			$user_posts = count_user_posts( $site_user, 'post' );
47
+	if (!empty($site_user)) {
48
+		if (is_user_member_of_blog($site_user)) {
49
+			$user_posts = count_user_posts($site_user, 'post');
50 50
 
51
-			if ( $user_posts > 0 ) {
51
+			if ($user_posts > 0) {
52 52
 				$params = array(
53 53
 					'post_type' => 'post',
54 54
 					'author' => $site_user,
@@ -76,16 +76,16 @@  discard block
 block discarded – undo
76 76
 					),
77 77
 				);
78 78
 
79
-				$posts_query = new \WP_Query( $params );
79
+				$posts_query = new \WP_Query($params);
80 80
 
81
-				if ( $posts_query->have_posts() ) {
81
+				if ($posts_query->have_posts()) {
82 82
 					$tab_post['post_type'] = 'post';
83
-					$tab_post['title'] = esc_html__( 'Posts', 'lsx-team' );
83
+					$tab_post['title'] = esc_html__('Posts', 'lsx-team');
84 84
 					$tab_post['posts'] = $posts_query->posts;
85 85
 
86
-					if ( ! empty( $tab_post['posts'] ) ) {
87
-						$post_ids = join( ',', $tab_post['posts'] );
88
-						$tab_post['shortcode'] = '[lsx_posts columns="3" limit="9" include="' . $post_ids . '"]';
86
+					if (!empty($tab_post['posts'])) {
87
+						$post_ids = join(',', $tab_post['posts']);
88
+						$tab_post['shortcode'] = '[lsx_posts columns="3" limit="9" include="'.$post_ids.'"]';
89 89
 						$tabs[] = $tab_post;
90 90
 					}
91 91
 				}
@@ -96,24 +96,24 @@  discard block
 block discarded – undo
96 96
 	// Tab Projects
97 97
 
98 98
 	$tab_project['post_type'] = 'project';
99
-	$tab_project['title'] = esc_html__( 'Projects', 'lsx-team' );
100
-	$tab_project['posts'] = get_post_meta( get_the_ID(), 'project_to_team', true );
101
-	if ( is_plugin_active( 'lsx-projects/lsx-projects.php' ) && ( ! empty( $tab_project['posts'] ) ) ) {
102
-		$post_ids = join( ',', $tab_project['posts'] );
103
-		$tab_project['shortcode'] = '[lsx_projects columns="3" include="' . $post_ids . '"]';
99
+	$tab_project['title'] = esc_html__('Projects', 'lsx-team');
100
+	$tab_project['posts'] = get_post_meta(get_the_ID(), 'project_to_team', true);
101
+	if (is_plugin_active('lsx-projects/lsx-projects.php') && (!empty($tab_project['posts']))) {
102
+		$post_ids = join(',', $tab_project['posts']);
103
+		$tab_project['shortcode'] = '[lsx_projects columns="3" include="'.$post_ids.'"]';
104 104
 		$tabs[] = $tab_project;
105 105
 	}
106 106
 
107 107
 	// Tab Services
108 108
 
109
-	if ( is_plugin_active( 'lsx-services/lsx-services.php' ) ) {
109
+	if (is_plugin_active('lsx-services/lsx-services.php')) {
110 110
 		$tab_service['post_type'] = 'service';
111
-		$tab_service['title'] = esc_html__( 'Services', 'lsx-team' );
112
-		$tab_service['posts'] = get_post_meta( get_the_ID(), 'service_to_team', true );
111
+		$tab_service['title'] = esc_html__('Services', 'lsx-team');
112
+		$tab_service['posts'] = get_post_meta(get_the_ID(), 'service_to_team', true);
113 113
 
114
-		if ( ! empty( $tab_service['posts'] ) ) {
115
-			$post_ids = join( ',', $tab_service['posts'] );
116
-			$tab_service['shortcode'] = '[lsx_services columns="3" include="' . $post_ids . '"]';
114
+		if (!empty($tab_service['posts'])) {
115
+			$post_ids = join(',', $tab_service['posts']);
116
+			$tab_service['shortcode'] = '[lsx_services columns="3" include="'.$post_ids.'"]';
117 117
 			$tabs[] = $tab_service;
118 118
 		}
119 119
 	}
@@ -121,18 +121,18 @@  discard block
 block discarded – undo
121 121
 	// Tab Testimonials
122 122
 
123 123
 	$tab_testimonial['post_type'] = 'testimonial';
124
-	$tab_testimonial['title'] = esc_html__( 'Testimonials', 'lsx-team' );
125
-	$tab_testimonial['posts'] = get_post_meta( get_the_ID(), 'testimonial_to_team', true );
124
+	$tab_testimonial['title'] = esc_html__('Testimonials', 'lsx-team');
125
+	$tab_testimonial['posts'] = get_post_meta(get_the_ID(), 'testimonial_to_team', true);
126 126
 
127
-	if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) {
128
-		if ( count( $tab_testimonial['posts'] ) <= 2 ) {
129
-			$columns = count( $tab_testimonial['posts'] );
127
+	if (is_plugin_active('lsx-testimonials/lsx-testimonials.php') && (!empty($tab_testimonial['posts']))) {
128
+		if (count($tab_testimonial['posts']) <= 2) {
129
+			$columns = count($tab_testimonial['posts']);
130 130
 		} else {
131 131
 			$columns = 2;
132 132
 		}
133 133
 
134
-		$post_ids = join( ',', $tab_testimonial['posts'] );
135
-		$tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
134
+		$post_ids = join(',', $tab_testimonial['posts']);
135
+		$tab_testimonial['shortcode'] = '[lsx_testimonials columns="'.$columns.'" include="'.$post_ids.'" orderby="date" order="DESC" display="excerpt"]';
136 136
 		$tabs[] = $tab_testimonial;
137 137
 	}
138 138
 ?>
@@ -146,15 +146,15 @@  discard block
 block discarded – undo
146 146
 	<div class="row">
147 147
 		<div class="col-xs-12 col-sm-6 col-md-4">
148 148
 			<figure class="lsx-team-avatar">
149
-				<?php echo wp_kses_post( $thumbnail ); ?>
149
+				<?php echo wp_kses_post($thumbnail); ?>
150 150
 			</figure>
151 151
 
152
-			<?php if ( count( $links ) > 0 ) : ?>
153
-				<span class="lsx-team-socials-header"><?php echo esc_html__( 'Follow', 'lsx-team' ) . ':'; ?></span>
152
+			<?php if (count($links) > 0) : ?>
153
+				<span class="lsx-team-socials-header"><?php echo esc_html__('Follow', 'lsx-team').':'; ?></span>
154 154
 
155 155
 				<ul class="lsx-team-socials list-inline">
156
-					<?php foreach ( $links as $service => $link ) : ?>
157
-						<li><a href="<?php echo esc_html( $link ); ?>" target="_blank" rel="nofollow noreferrer noopener"><i class="fa fa-<?php echo esc_html( $service ); ?>" aria-hidden="true"></i></a></li>
156
+					<?php foreach ($links as $service => $link) : ?>
157
+						<li><a href="<?php echo esc_html($link); ?>" target="_blank" rel="nofollow noreferrer noopener"><i class="fa fa-<?php echo esc_html($service); ?>" aria-hidden="true"></i></a></li>
158 158
 					<?php endforeach; ?>
159 159
 				</ul>
160 160
 			<?php endif; ?>
@@ -162,39 +162,39 @@  discard block
 block discarded – undo
162 162
 
163 163
 		<div class="col-xs-12 col-sm-6 col-md-8">
164 164
 			<h1 class="lsx-team-name"><?php the_title(); ?></h1>
165
-			<h5 class="lsx-team-job-title"><?php echo esc_html( $job_title ); ?></h5>
165
+			<h5 class="lsx-team-job-title"><?php echo esc_html($job_title); ?></h5>
166 166
 			<div class="lsx-team-content"><?php the_content(); ?></div>
167 167
 
168
-			<?php if ( ! empty( $email ) || ! empty( $phone ) || ! empty( $skype ) ) : ?>
168
+			<?php if (!empty($email) || !empty($phone) || !empty($skype)) : ?>
169 169
 				<ul class="lsx-team-contact list-inline">
170
-					<?php if ( ! empty( $email ) ) : ?>
171
-						<li><a href="mailto:<?php echo esc_attr( $email ); ?>"><i class="fa fa-envelope-o" aria-hidden="true"></i> <?php echo esc_attr( $email ); ?></a></li>
170
+					<?php if (!empty($email)) : ?>
171
+						<li><a href="mailto:<?php echo esc_attr($email); ?>"><i class="fa fa-envelope-o" aria-hidden="true"></i> <?php echo esc_attr($email); ?></a></li>
172 172
 					<?php endif; ?>
173 173
 
174
-					<?php if ( ! empty( $phone ) ) : ?>
175
-						<li><a href="tel:<?php echo esc_attr( $phone_attr ); ?>"><i class="fa fa-phone" aria-hidden="true"></i> <?php echo esc_attr( $phone ); ?></a></li>
174
+					<?php if (!empty($phone)) : ?>
175
+						<li><a href="tel:<?php echo esc_attr($phone_attr); ?>"><i class="fa fa-phone" aria-hidden="true"></i> <?php echo esc_attr($phone); ?></a></li>
176 176
 					<?php endif; ?>
177 177
 
178
-					<?php if ( ! empty( $skype ) ) : ?>
179
-						<li><i class="fa fa-skype" aria-hidden="true"></i> <?php echo esc_attr( $skype ); ?></li>
178
+					<?php if (!empty($skype)) : ?>
179
+						<li><i class="fa fa-skype" aria-hidden="true"></i> <?php echo esc_attr($skype); ?></li>
180 180
 					<?php endif; ?>
181 181
 				</ul>
182 182
 			<?php endif; ?>
183 183
 		</div>
184 184
 	</div>
185 185
 
186
-	<?php if ( count( $tabs ) > 0 ) : ?>
186
+	<?php if (count($tabs) > 0) : ?>
187 187
 		<div class="entry-tabs">
188 188
 			<ul class="nav nav-tabs">
189
-				<?php foreach ( $tabs as $i => $tab ) : ?>
190
-					<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>
189
+				<?php foreach ($tabs as $i => $tab) : ?>
190
+					<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>
191 191
 				<?php endforeach; ?>
192 192
 			</ul>
193 193
 
194 194
 			<div class="tab-content">
195
-				<?php foreach ( $tabs as $i => $tab ) : ?>
196
-					<div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>">
197
-						<?php echo do_shortcode( $tab['shortcode'] ); ?>
195
+				<?php foreach ($tabs as $i => $tab) : ?>
196
+					<div id="<?php echo esc_attr(sanitize_title($tab['title'])); ?>" class="tab-pane fade<?php if (0 === $i) echo ' in active'; ?>">
197
+						<?php echo do_shortcode($tab['shortcode']); ?>
198 198
 					</div>
199 199
 				<?php endforeach; ?>
200 200
 			</div>
Please login to merge, or discard this patch.
lsx-team.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,35 +13,35 @@
 block discarded – undo
13 13
  */
14 14
 
15 15
 // If this file is called directly, abort.
16
-if ( ! defined( 'WPINC' ) ) {
16
+if (!defined('WPINC')) {
17 17
 	die;
18 18
 }
19 19
 
20
-define( 'LSX_TEAM_PATH', plugin_dir_path( __FILE__ ) );
21
-define( 'LSX_TEAM_CORE', __FILE__ );
22
-define( 'LSX_TEAM_URL', plugin_dir_url( __FILE__ ) );
23
-define( 'LSX_TEAM_VER', '1.3.1' );
20
+define('LSX_TEAM_PATH', plugin_dir_path(__FILE__));
21
+define('LSX_TEAM_CORE', __FILE__);
22
+define('LSX_TEAM_URL', plugin_dir_url(__FILE__));
23
+define('LSX_TEAM_VER', '1.3.1');
24 24
 
25 25
 
26 26
 /* ======================= Below is the Plugin Class init ========================= */
27 27
 
28 28
 // Template Tag and functions.
29
-require_once LSX_TEAM_PATH . '/includes/functions.php';
29
+require_once LSX_TEAM_PATH.'/includes/functions.php';
30 30
 
31 31
 // Core Class.
32
-require_once LSX_TEAM_PATH . '/classes/class-lsx-team-core.php';
32
+require_once LSX_TEAM_PATH.'/classes/class-lsx-team-core.php';
33 33
 
34 34
 // Post Type and Custom Fields.
35
-require_once LSX_TEAM_PATH . '/classes/class-lsx-team-admin.php';
35
+require_once LSX_TEAM_PATH.'/classes/class-lsx-team-admin.php';
36 36
 
37 37
 // Frontend resources.
38
-require_once LSX_TEAM_PATH . '/classes/class-lsx-team-frontend.php';
38
+require_once LSX_TEAM_PATH.'/classes/class-lsx-team-frontend.php';
39 39
 
40 40
 // Shortcode.
41
-require_once LSX_TEAM_PATH . '/classes/class-lsx-team.php';
41
+require_once LSX_TEAM_PATH.'/classes/class-lsx-team.php';
42 42
 
43 43
 // Widget.
44
-require_once LSX_TEAM_PATH . '/classes/class-lsx-team-widget.php';
44
+require_once LSX_TEAM_PATH.'/classes/class-lsx-team-widget.php';
45 45
 
46 46
 // Post reorder.
47
-require_once LSX_TEAM_PATH . '/includes/class-lsx-team-scpo-engine.php';
47
+require_once LSX_TEAM_PATH.'/includes/class-lsx-team-scpo-engine.php';
Please login to merge, or discard this patch.