Completed
Push — master ( bf1080...d99bb1 )
by Md. Mozahidur
04:04
created
includes/acf/pro/fields/repeater.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 		
51 51
 		
52 52
 		// do not delete!
53
-    	parent::__construct();
53
+		parent::__construct();
54 54
 	}
55 55
 		
56 56
 	
Please login to merge, or discard this patch.
Spacing   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 *  @subpackage	Fields
12 12
 */
13 13
 
14
-if( ! class_exists('acf_field_repeater') ) :
14
+if ( ! class_exists('acf_field_repeater')) :
15 15
 
16 16
 class acf_field_repeater extends acf_field {
17 17
 	
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
 		
34 34
 		// vars
35 35
 		$this->name = 'repeater';
36
-		$this->label = __("Repeater",'acf');
36
+		$this->label = __("Repeater", 'acf');
37 37
 		$this->category = 'layout';
38 38
 		$this->defaults = array(
39 39
 			'sub_fields'	=> array(),
40 40
 			'min'			=> 0,
41 41
 			'max'			=> 0,
42 42
 			'layout' 		=> 'table',
43
-			'button_label'	=> __("Add Row",'acf'),
43
+			'button_label'	=> __("Add Row", 'acf'),
44 44
 			'collapsed'		=> ''
45 45
 		);
46 46
 		$this->l10n = array(
47
-			'min'			=>	__("Minimum rows reached ({min} rows)",'acf'),
48
-			'max'			=>	__("Maximum rows reached ({max} rows)",'acf'),
47
+			'min'			=>	__("Minimum rows reached ({min} rows)", 'acf'),
48
+			'max'			=>	__("Maximum rows reached ({max} rows)", 'acf'),
49 49
 		);
50 50
 		
51 51
 		
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 	*  @return	$field - the field array holding all the field options
69 69
 	*/
70 70
 	
71
-	function load_field( $field ) {
71
+	function load_field($field) {
72 72
 		
73
-		$field['sub_fields'] = acf_get_fields( $field );
73
+		$field['sub_fields'] = acf_get_fields($field);
74 74
 		
75 75
 		
76 76
 		// return
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	*  @date	23/01/13
92 92
 	*/
93 93
 	
94
-	function render_field( $field ) {
94
+	function render_field($field) {
95 95
 		
96 96
 		// vars
97 97
 		$div = array(
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		
103 103
 		
104 104
 		// ensure value is an array
105
-		if( empty($field['value']) ) {
105
+		if (empty($field['value'])) {
106 106
 		
107 107
 			$field['value'] = array();
108 108
 			
@@ -121,12 +121,12 @@  discard block
 block discarded – undo
121 121
 		
122 122
 		
123 123
 		// If there are less values than min, populate the extra values
124
-		if( $field['min'] ) {
124
+		if ($field['min']) {
125 125
 			
126
-			for( $i = 0; $i < $field['min']; $i++ ) {
126
+			for ($i = 0; $i < $field['min']; $i++) {
127 127
 			
128 128
 				// continue if already have a value
129
-				if( array_key_exists($i, $field['value']) ) {
129
+				if (array_key_exists($i, $field['value'])) {
130 130
 				
131 131
 					continue;
132 132
 					
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 				
135 135
 				
136 136
 				// populate values
137
-				$field['value'][ $i ] = $empty_row;
137
+				$field['value'][$i] = $empty_row;
138 138
 				
139 139
 			}
140 140
 			
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
 		
143 143
 		
144 144
 		// If there are more values than man, remove some values
145
-		if( $field['max'] ) {
145
+		if ($field['max']) {
146 146
 		
147
-			for( $i = 0; $i < count($field['value']); $i++ ) {
147
+			for ($i = 0; $i < count($field['value']); $i++) {
148 148
 			
149
-				if( $i >= $field['max'] ) {
149
+				if ($i >= $field['max']) {
150 150
 				
151
-					unset( $field['value'][ $i ] );
151
+					unset($field['value'][$i]);
152 152
 					
153 153
 				}
154 154
 				
@@ -167,15 +167,15 @@  discard block
 block discarded – undo
167 167
 		$show_remove = true;
168 168
 		
169 169
 		
170
-		if( $field['max'] ) {
170
+		if ($field['max']) {
171 171
 		
172
-			if( $field['max'] == 1 ) {
172
+			if ($field['max'] == 1) {
173 173
 			
174 174
 				$show_order = false;
175 175
 				
176 176
 			}
177 177
 			
178
-			if( $field['max'] <= $field['min'] ) {
178
+			if ($field['max'] <= $field['min']) {
179 179
 			
180 180
 				$show_remove = false;
181 181
 				$show_add = false;
@@ -190,13 +190,13 @@  discard block
 block discarded – undo
190 190
 		$before_fields = '';
191 191
 		$after_fields = '';
192 192
 		
193
-		if( $field['layout'] == 'row' ) {
193
+		if ($field['layout'] == 'row') {
194 194
 		
195 195
 			$el = 'div';
196 196
 			$before_fields = '<td class="acf-fields -left">';
197 197
 			$after_fields = '</td>';
198 198
 			
199
-		} elseif( $field['layout'] == 'block' ) {
199
+		} elseif ($field['layout'] == 'block') {
200 200
 		
201 201
 			$el = 'div';
202 202
 			
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		
208 208
 		
209 209
 		// layout
210
-		$div['class'] .= ' -' . $field['layout'];
210
+		$div['class'] .= ' -'.$field['layout'];
211 211
 		
212 212
 		
213 213
 		// hidden input
@@ -220,20 +220,20 @@  discard block
 block discarded – undo
220 220
 		// collapsed
221 221
 		$collapsed = array();
222 222
 		
223
-		if( $field['collapsed'] ) {
223
+		if ($field['collapsed']) {
224 224
 			
225 225
 			// get user setting
226
-			$collapsed = acf_get_user_setting('collapsed_' . $field['key'], '');
226
+			$collapsed = acf_get_user_setting('collapsed_'.$field['key'], '');
227 227
 			$collapsed = explode(',', $collapsed);
228 228
 			$collapsed = array_filter($collapsed, 'is_numeric');
229 229
 			
230 230
 			
231 231
 			// add target class
232
-			foreach( array_keys($field['sub_fields']) as $i ) {
232
+			foreach (array_keys($field['sub_fields']) as $i) {
233 233
 				
234
-				if( $field['sub_fields'][ $i ]['key'] === $field['collapsed'] ) {
234
+				if ($field['sub_fields'][$i]['key'] === $field['collapsed']) {
235 235
 					
236
-					$field['sub_fields'][ $i ]['wrapper']['class'] .= ' -collapsed-target';
236
+					$field['sub_fields'][$i]['wrapper']['class'] .= ' -collapsed-target';
237 237
 					
238 238
 				}
239 239
 								
@@ -245,14 +245,14 @@  discard block
 block discarded – undo
245 245
 <div <?php acf_esc_attr_e($div); ?>>
246 246
 <table class="acf-table">
247 247
 	
248
-	<?php if( $field['layout'] == 'table' ): ?>
248
+	<?php if ($field['layout'] == 'table'): ?>
249 249
 		<thead>
250 250
 			<tr>
251
-				<?php if( $show_order ): ?>
251
+				<?php if ($show_order): ?>
252 252
 					<th class="acf-row-handle"><span></span></th>
253 253
 				<?php endif; ?>
254 254
 				
255
-				<?php foreach( $field['sub_fields'] as $sub_field ): 
255
+				<?php foreach ($field['sub_fields'] as $sub_field): 
256 256
 					
257 257
 					$atts = array(
258 258
 						'class'		=> 'acf-th',
@@ -261,27 +261,27 @@  discard block
 block discarded – undo
261 261
 					
262 262
 					
263 263
 					// add type
264
-					$atts['class'] .= ' acf-th-' . $sub_field['type'];
264
+					$atts['class'] .= ' acf-th-'.$sub_field['type'];
265 265
 					
266 266
 					
267 267
 					// Add custom width
268
-					if( $sub_field['wrapper']['width'] ) {
268
+					if ($sub_field['wrapper']['width']) {
269 269
 					
270 270
 						$atts['data-width'] = $sub_field['wrapper']['width'];
271 271
 						
272 272
 					}
273 273
 						
274 274
 					?>
275
-					<th <?php acf_esc_attr_e( $atts ); ?>>
276
-						<?php echo acf_get_field_label( $sub_field ); ?>
277
-						<?php if( $sub_field['instructions'] ): ?>
275
+					<th <?php acf_esc_attr_e($atts); ?>>
276
+						<?php echo acf_get_field_label($sub_field); ?>
277
+						<?php if ($sub_field['instructions']): ?>
278 278
 							<p class="description"><?php echo $sub_field['instructions']; ?></p>
279 279
 						<?php endif; ?>
280 280
 					</th>
281 281
 					
282 282
 				<?php endforeach; ?>
283 283
 
284
-				<?php if( $show_remove ): ?>
284
+				<?php if ($show_remove): ?>
285 285
 					<th class="acf-row-handle"><span></span></th>
286 286
 				<?php endif; ?>
287 287
 			</tr>
@@ -289,15 +289,15 @@  discard block
 block discarded – undo
289 289
 	<?php endif; ?>
290 290
 	
291 291
 	<tbody>
292
-		<?php foreach( $field['value'] as $i => $row ): 
292
+		<?php foreach ($field['value'] as $i => $row): 
293 293
 			
294 294
 			$row_class = 'acf-row';
295 295
 			
296
-			if( $i === 'acfcloneindex' ) {
296
+			if ($i === 'acfcloneindex') {
297 297
 				
298 298
 				$row_class .= ' acf-clone';
299 299
 				
300
-			} elseif( in_array($i, $collapsed) ) {
300
+			} elseif (in_array($i, $collapsed)) {
301 301
 				
302 302
 				$row_class .= ' -collapsed';
303 303
 				
@@ -306,10 +306,10 @@  discard block
 block discarded – undo
306 306
 			?>
307 307
 			<tr class="<?php echo $row_class; ?>" data-id="<?php echo $i; ?>">
308 308
 				
309
-				<?php if( $show_order ): ?>
310
-					<td class="acf-row-handle order" title="<?php _e('Drag to reorder','acf'); ?>">
311
-						<?php if( $field['collapsed'] ): ?>
312
-						<a class="acf-icon -collapse small" href="#" data-event="collapse-row" title="<?php _e('Click to toggle','acf'); ?>"></a>
309
+				<?php if ($show_order): ?>
310
+					<td class="acf-row-handle order" title="<?php _e('Drag to reorder', 'acf'); ?>">
311
+						<?php if ($field['collapsed']): ?>
312
+						<a class="acf-icon -collapse small" href="#" data-event="collapse-row" title="<?php _e('Click to toggle', 'acf'); ?>"></a>
313 313
 						<?php endif; ?>
314 314
 						<span><?php echo intval($i) + 1; ?></span>
315 315
 					</td>
@@ -317,10 +317,10 @@  discard block
 block discarded – undo
317 317
 				
318 318
 				<?php echo $before_fields; ?>
319 319
 				
320
-				<?php foreach( $field['sub_fields'] as $sub_field ): 
320
+				<?php foreach ($field['sub_fields'] as $sub_field): 
321 321
 					
322 322
 					// prevent repeater field from creating multiple conditional logic items for each row
323
-					if( $i !== 'acfcloneindex' ) {
323
+					if ($i !== 'acfcloneindex') {
324 324
 					
325 325
 						$sub_field['conditional_logic'] = 0;
326 326
 						
@@ -328,12 +328,12 @@  discard block
 block discarded – undo
328 328
 					
329 329
 					
330 330
 					// add value
331
-					if( isset($row[ $sub_field['key'] ]) ) {
331
+					if (isset($row[$sub_field['key']])) {
332 332
 						
333 333
 						// this is a normal value
334
-						$sub_field['value'] = $row[ $sub_field['key'] ];
334
+						$sub_field['value'] = $row[$sub_field['key']];
335 335
 						
336
-					} elseif( isset($sub_field['default_value']) ) {
336
+					} elseif (isset($sub_field['default_value'])) {
337 337
 						
338 338
 						// no value, but this sub field has a default value
339 339
 						$sub_field['value'] = $sub_field['default_value'];
@@ -346,16 +346,16 @@  discard block
 block discarded – undo
346 346
 					
347 347
 					
348 348
 					// render input
349
-					acf_render_field_wrap( $sub_field, $el ); ?>
349
+					acf_render_field_wrap($sub_field, $el); ?>
350 350
 					
351 351
 				<?php endforeach; ?>
352 352
 				
353 353
 				<?php echo $after_fields; ?>
354 354
 				
355
-				<?php if( $show_remove ): ?>
355
+				<?php if ($show_remove): ?>
356 356
 					<td class="acf-row-handle remove">
357
-						<a class="acf-icon -plus small" href="#" data-event="add-row" title="<?php _e('Add row','acf'); ?>"></a>
358
-						<a class="acf-icon -minus small" href="#" data-event="remove-row" title="<?php _e('Remove row','acf'); ?>"></a>
357
+						<a class="acf-icon -plus small" href="#" data-event="add-row" title="<?php _e('Add row', 'acf'); ?>"></a>
358
+						<a class="acf-icon -minus small" href="#" data-event="remove-row" title="<?php _e('Remove row', 'acf'); ?>"></a>
359 359
 					</td>
360 360
 				<?php endif; ?>
361 361
 				
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 		<?php endforeach; ?>
364 364
 	</tbody>
365 365
 </table>
366
-<?php if( $show_add ): ?>
366
+<?php if ($show_add): ?>
367 367
 	
368 368
 	<ul class="acf-hl">
369 369
 		<li class="acf-fr">
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 	*  @param	$field	- an array holding all the field's data
392 392
 	*/
393 393
 	
394
-	function render_field_settings( $field ) {
394
+	function render_field_settings($field) {
395 395
 		
396 396
 		// vars
397 397
 		$args = array(
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		
404 404
 		?><tr class="acf-field" data-setting="repeater" data-name="sub_fields">
405 405
 			<td class="acf-label">
406
-				<label><?php _e("Sub Fields",'acf'); ?></label>
406
+				<label><?php _e("Sub Fields", 'acf'); ?></label>
407 407
 				<p class="description"></p>		
408 408
 			</td>
409 409
 			<td class="acf-input">
@@ -425,16 +425,16 @@  discard block
 block discarded – undo
425 425
 		// preview
426 426
 		$choices = array();
427 427
 		
428
-		if( $field['collapsed'] ) {
428
+		if ($field['collapsed']) {
429 429
 			
430
-			$choices[ $field['collapsed'] ] = $field['collapsed'];
430
+			$choices[$field['collapsed']] = $field['collapsed'];
431 431
 			
432 432
 		}
433 433
 		
434 434
 		
435
-		acf_render_field_setting( $field, array(
436
-			'label'			=> __('Collapsed','acf'),
437
-			'instructions'	=> __('Select a sub field to show when row is collapsed','acf'),
435
+		acf_render_field_setting($field, array(
436
+			'label'			=> __('Collapsed', 'acf'),
437
+			'instructions'	=> __('Select a sub field to show when row is collapsed', 'acf'),
438 438
 			'type'			=> 'select',
439 439
 			'name'			=> 'collapsed',
440 440
 			'allow_null'	=> 1,
@@ -443,8 +443,8 @@  discard block
 block discarded – undo
443 443
 		
444 444
 		
445 445
 		// min
446
-		acf_render_field_setting( $field, array(
447
-			'label'			=> __('Minimum Rows','acf'),
446
+		acf_render_field_setting($field, array(
447
+			'label'			=> __('Minimum Rows', 'acf'),
448 448
 			'instructions'	=> '',
449 449
 			'type'			=> 'number',
450 450
 			'name'			=> 'min',
@@ -453,8 +453,8 @@  discard block
 block discarded – undo
453 453
 		
454 454
 		
455 455
 		// max
456
-		acf_render_field_setting( $field, array(
457
-			'label'			=> __('Maximum Rows','acf'),
456
+		acf_render_field_setting($field, array(
457
+			'label'			=> __('Maximum Rows', 'acf'),
458 458
 			'instructions'	=> '',
459 459
 			'type'			=> 'number',
460 460
 			'name'			=> 'max',
@@ -463,24 +463,24 @@  discard block
 block discarded – undo
463 463
 		
464 464
 		
465 465
 		// layout
466
-		acf_render_field_setting( $field, array(
467
-			'label'			=> __('Layout','acf'),
466
+		acf_render_field_setting($field, array(
467
+			'label'			=> __('Layout', 'acf'),
468 468
 			'instructions'	=> '',
469 469
 			'class'			=> 'acf-repeater-layout',
470 470
 			'type'			=> 'radio',
471 471
 			'name'			=> 'layout',
472 472
 			'layout'		=> 'horizontal',
473 473
 			'choices'		=> array(
474
-				'table'			=> __('Table','acf'),
475
-				'block'			=> __('Block','acf'),
476
-				'row'			=> __('Row','acf')
474
+				'table'			=> __('Table', 'acf'),
475
+				'block'			=> __('Block', 'acf'),
476
+				'row'			=> __('Row', 'acf')
477 477
 			)
478 478
 		));
479 479
 		
480 480
 		
481 481
 		// button_label
482
-		acf_render_field_setting( $field, array(
483
-			'label'			=> __('Button Label','acf'),
482
+		acf_render_field_setting($field, array(
483
+			'label'			=> __('Button Label', 'acf'),
484 484
 			'instructions'	=> '',
485 485
 			'type'			=> 'text',
486 486
 			'name'			=> 'button_label',
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
 	*  @return	$value
505 505
 	*/
506 506
 	
507
-	function load_value( $value, $post_id, $field ) {
507
+	function load_value($value, $post_id, $field) {
508 508
 		
509 509
 		// bail early if no value
510
-		if( empty($value) || empty($field['sub_fields']) ) {
510
+		if (empty($value) || empty($field['sub_fields'])) {
511 511
 			
512 512
 			return $value;
513 513
 			
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 		
516 516
 		
517 517
 		// convert to int
518
-		$value = intval( $value );
518
+		$value = intval($value);
519 519
 		
520 520
 		
521 521
 		// vars
@@ -523,20 +523,20 @@  discard block
 block discarded – undo
523 523
 		
524 524
 		
525 525
 		// check number of rows
526
-		if( $value > 0 ) {
526
+		if ($value > 0) {
527 527
 			
528 528
 			// loop through rows
529
-			for( $i = 0; $i < $value; $i++ ) {
529
+			for ($i = 0; $i < $value; $i++) {
530 530
 				
531 531
 				// create empty array
532
-				$rows[ $i ] = array();
532
+				$rows[$i] = array();
533 533
 				
534 534
 				
535 535
 				// loop through sub fields
536
-				foreach( array_keys($field['sub_fields']) as $j ) {
536
+				foreach (array_keys($field['sub_fields']) as $j) {
537 537
 					
538 538
 					// get sub field
539
-					$sub_field = $field['sub_fields'][ $j ];
539
+					$sub_field = $field['sub_fields'][$j];
540 540
 					
541 541
 					
542 542
 					// update $sub_field name
@@ -544,11 +544,11 @@  discard block
 block discarded – undo
544 544
 					
545 545
 					
546 546
 					// get value
547
-					$sub_value = acf_get_value( $post_id, $sub_field );
547
+					$sub_value = acf_get_value($post_id, $sub_field);
548 548
 				
549 549
 				
550 550
 					// add value
551
-					$rows[ $i ][ $sub_field['key'] ] = $sub_value;
551
+					$rows[$i][$sub_field['key']] = $sub_value;
552 552
 					
553 553
 				}
554 554
 				// foreach
@@ -582,10 +582,10 @@  discard block
 block discarded – undo
582 582
 	*  @return	$value (mixed) the modified value
583 583
 	*/
584 584
 	
585
-	function format_value( $value, $post_id, $field ) {
585
+	function format_value($value, $post_id, $field) {
586 586
 		
587 587
 		// bail early if no value
588
-		if( empty($value) || empty($field['sub_fields']) ) {
588
+		if (empty($value) || empty($field['sub_fields'])) {
589 589
 						
590 590
 			return false;
591 591
 			
@@ -593,25 +593,25 @@  discard block
 block discarded – undo
593 593
 		
594 594
 		
595 595
 		// loop over rows
596
-		foreach( array_keys($value) as $i ) {
596
+		foreach (array_keys($value) as $i) {
597 597
 			
598 598
 			// loop through sub fields
599
-			foreach( array_keys($field['sub_fields']) as $j ) {
599
+			foreach (array_keys($field['sub_fields']) as $j) {
600 600
 				
601 601
 				// get sub field
602
-				$sub_field = $field['sub_fields'][ $j ];
602
+				$sub_field = $field['sub_fields'][$j];
603 603
 				
604 604
 				
605 605
 				// extract value
606
-				$sub_value = acf_extract_var( $value[ $i ], $sub_field['key'] );
606
+				$sub_value = acf_extract_var($value[$i], $sub_field['key']);
607 607
 				
608 608
 				
609 609
 				// format value
610
-				$sub_value = acf_format_value( $sub_value, $post_id, $sub_field );
610
+				$sub_value = acf_format_value($sub_value, $post_id, $sub_field);
611 611
 				
612 612
 				
613 613
 				// append to $row
614
-				$value[ $i ][ $sub_field['name'] ] = $sub_value;
614
+				$value[$i][$sub_field['name']] = $sub_value;
615 615
 				
616 616
 			}
617 617
 			
@@ -637,10 +637,10 @@  discard block
 block discarded – undo
637 637
 	*  @return	$post_id (int)
638 638
 	*/
639 639
 	
640
-	function validate_value( $valid, $value, $field, $input ){
640
+	function validate_value($valid, $value, $field, $input) {
641 641
 		
642 642
 		// remove acfcloneindex
643
-		if( isset($value['acfcloneindex']) ) {
643
+		if (isset($value['acfcloneindex'])) {
644 644
 		
645 645
 			unset($value['acfcloneindex']);
646 646
 			
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 		
649 649
 		
650 650
 		// valid
651
-		if( $field['required'] && empty($value) ) {
651
+		if ($field['required'] && empty($value)) {
652 652
 		
653 653
 			$valid = false;
654 654
 			
@@ -656,20 +656,20 @@  discard block
 block discarded – undo
656 656
 		
657 657
 		
658 658
 		// check sub fields
659
-		if( !empty($field['sub_fields']) && !empty($value) ) {
659
+		if ( ! empty($field['sub_fields']) && ! empty($value)) {
660 660
 			
661 661
 			$keys = array_keys($value);
662 662
 			
663
-			foreach( $keys as $i ) {
663
+			foreach ($keys as $i) {
664 664
 				
665
-				foreach( $field['sub_fields'] as $sub_field ) {
665
+				foreach ($field['sub_fields'] as $sub_field) {
666 666
 					
667 667
 					// vars
668 668
 					$k = $sub_field['key'];
669 669
 					
670 670
 					
671 671
 					// test sub field exists
672
-					if( !isset($value[ $i ][ $k ]) ) {
672
+					if ( ! isset($value[$i][$k])) {
673 673
 					
674 674
 						continue;
675 675
 						
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 					
678 678
 					
679 679
 					// validate
680
-					acf_validate_value( $value[ $i ][ $k ], $sub_field, "{$input}[{$i}][{$k}]" );
680
+					acf_validate_value($value[$i][$k], $sub_field, "{$input}[{$i}][{$k}]");
681 681
 				}
682 682
 				
683 683
 			}
@@ -705,14 +705,14 @@  discard block
 block discarded – undo
705 705
 	*  @return	$value - the modified value
706 706
 	*/
707 707
 	
708
-	function update_value( $value, $post_id, $field ) {
708
+	function update_value($value, $post_id, $field) {
709 709
 		
710 710
 		// vars
711 711
 		$total = 0;
712 712
 		
713 713
 		
714 714
 		// remove acfcloneindex
715
-		if( isset($value['acfcloneindex']) ) {
715
+		if (isset($value['acfcloneindex'])) {
716 716
 		
717 717
 			unset($value['acfcloneindex']);
718 718
 			
@@ -720,14 +720,14 @@  discard block
 block discarded – undo
720 720
 		
721 721
 		
722 722
 		// update sub fields
723
-		if( !empty($value) ) {
723
+		if ( ! empty($value)) {
724 724
 			
725 725
 			// $i
726 726
 			$i = -1;
727 727
 			
728 728
 			
729 729
 			// loop through rows
730
-			foreach( $value as $row ) {	
730
+			foreach ($value as $row) {	
731 731
 				
732 732
 				// $i
733 733
 				$i++;
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 				
739 739
 				
740 740
 				// continue if no sub fields
741
-				if( !$field['sub_fields'] ) {
741
+				if ( ! $field['sub_fields']) {
742 742
 					
743 743
 					continue;
744 744
 					
@@ -746,20 +746,20 @@  discard block
 block discarded – undo
746 746
 					
747 747
 					
748 748
 				// loop through sub fields
749
-				foreach( $field['sub_fields'] as $sub_field ) {
749
+				foreach ($field['sub_fields'] as $sub_field) {
750 750
 					
751 751
 					// value
752 752
 					$v = false;
753 753
 					
754 754
 					
755 755
 					// key (backend)
756
-					if( isset($row[ $sub_field['key'] ]) ) {
756
+					if (isset($row[$sub_field['key']])) {
757 757
 						
758
-						$v = $row[ $sub_field['key'] ];
758
+						$v = $row[$sub_field['key']];
759 759
 						
760
-					} elseif( isset($row[ $sub_field['name'] ]) ) {
760
+					} elseif (isset($row[$sub_field['name']])) {
761 761
 						
762
-						$v = $row[ $sub_field['name'] ];
762
+						$v = $row[$sub_field['name']];
763 763
 						
764 764
 					} else {
765 765
 						
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 					
775 775
 					
776 776
 					// update value
777
-					acf_update_value( $v, $post_id, $sub_field );
777
+					acf_update_value($v, $post_id, $sub_field);
778 778
 					
779 779
 				}
780 780
 				// foreach
@@ -787,20 +787,20 @@  discard block
 block discarded – undo
787 787
 		
788 788
 		
789 789
 		// get old value (db only)
790
-		$old_total = (int) acf_get_metadata( $post_id, $field['name'] );
790
+		$old_total = (int) acf_get_metadata($post_id, $field['name']);
791 791
 		
792
-		if( $old_total > $total ) {
792
+		if ($old_total > $total) {
793 793
 			
794
-			for( $i = $total; $i < $old_total; $i++ ) {
794
+			for ($i = $total; $i < $old_total; $i++) {
795 795
 				
796
-				foreach( $field['sub_fields'] as $sub_field ) {
796
+				foreach ($field['sub_fields'] as $sub_field) {
797 797
 					
798 798
 					// modify name for delete
799 799
 					$sub_field['name'] = "{$field['name']}_{$i}_{$sub_field['name']}";
800 800
 					
801 801
 					
802 802
 					// delete value
803
-					acf_delete_value( $post_id, $sub_field );
803
+					acf_delete_value($post_id, $sub_field);
804 804
 				
805 805
 				}
806 806
 				// foreach
@@ -834,30 +834,30 @@  discard block
 block discarded – undo
834 834
 	*  @return	$post_id (int)
835 835
 	*/
836 836
 	
837
-	function delete_value( $post_id, $key, $field ) {
837
+	function delete_value($post_id, $key, $field) {
838 838
 		
839 839
 		// get old value (db only)
840
-		$old_total = (int) acf_get_metadata( $post_id, $field['name'] );
840
+		$old_total = (int) acf_get_metadata($post_id, $field['name']);
841 841
 		
842 842
 		
843 843
 		// bail early if no rows or no sub fields
844
-		if( !$old_total || !$field['sub_fields'] ) {
844
+		if ( ! $old_total || ! $field['sub_fields']) {
845 845
 			
846 846
 			return;
847 847
 			
848 848
 		}
849 849
 		
850 850
 		
851
-		for( $i = 0; $i < $old_total; $i++ ) {
851
+		for ($i = 0; $i < $old_total; $i++) {
852 852
 			
853
-			foreach( $field['sub_fields'] as $sub_field ) {
853
+			foreach ($field['sub_fields'] as $sub_field) {
854 854
 				
855 855
 				// modify name for delete
856 856
 				$sub_field['name'] = "{$key}_{$i}_{$sub_field['name']}";
857 857
 				
858 858
 				
859 859
 				// delete value
860
-				acf_delete_value( $post_id, $sub_field );
860
+				acf_delete_value($post_id, $sub_field);
861 861
 			
862 862
 			}
863 863
 			// foreach
@@ -880,14 +880,14 @@  discard block
 block discarded – undo
880 880
 	*  @return	$post_id (int)
881 881
 	*/
882 882
 	
883
-	function delete_field( $field ) {
883
+	function delete_field($field) {
884 884
 		
885 885
 		// loop through sub fields
886
-		if( !empty($field['sub_fields']) ) {
886
+		if ( ! empty($field['sub_fields'])) {
887 887
 		
888
-			foreach( $field['sub_fields'] as $sub_field ) {
888
+			foreach ($field['sub_fields'] as $sub_field) {
889 889
 			
890
-				acf_delete_field( $sub_field['ID'] );
890
+				acf_delete_field($sub_field['ID']);
891 891
 				
892 892
 			}
893 893
 			
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 	*  @return	$field - the modified field
912 912
 	*/
913 913
 
914
-	function update_field( $field ) {
914
+	function update_field($field) {
915 915
 		
916 916
 		// remove sub fields
917 917
 		unset($field['sub_fields']);
@@ -936,18 +936,18 @@  discard block
 block discarded – undo
936 936
 	*  @return	$field - the modified field
937 937
 	*/
938 938
 
939
-	function duplicate_field( $field ) {
939
+	function duplicate_field($field) {
940 940
 		
941 941
 		// get sub fields
942
-		$sub_fields = acf_extract_var( $field, 'sub_fields' );
942
+		$sub_fields = acf_extract_var($field, 'sub_fields');
943 943
 		
944 944
 		
945 945
 		// save field to get ID
946
-		$field = acf_update_field( $field );
946
+		$field = acf_update_field($field);
947 947
 		
948 948
 		
949 949
 		// duplicate sub fields
950
-		acf_duplicate_fields( $sub_fields, $field['ID'] );
950
+		acf_duplicate_fields($sub_fields, $field['ID']);
951 951
 		
952 952
 						
953 953
 		// return		
Please login to merge, or discard this patch.
includes/menus.php 2 patches
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
  *
6 6
  */
7 7
 function lighthouse_menus() {
8
-    register_nav_menus(
9
-        array(
10
-            'header-menu-left' => __( 'Header menu left', 'nav menu location', 'lighthouse' ),
11
-            'header-menu-right' => __( 'Header menu right' , 'nav menu location', 'lighthouse'),
12
-            'footer-menu' => __( 'Footer menu' , 'nav menu location', 'lighthouse'),
13
-            'footer-menu-bottom' => __( 'Footer menu bottom' , 'nav menu location', 'lighthouse')
14
-            )
15
-        );
8
+	register_nav_menus(
9
+		array(
10
+			'header-menu-left' => __( 'Header menu left', 'nav menu location', 'lighthouse' ),
11
+			'header-menu-right' => __( 'Header menu right' , 'nav menu location', 'lighthouse'),
12
+			'footer-menu' => __( 'Footer menu' , 'nav menu location', 'lighthouse'),
13
+			'footer-menu-bottom' => __( 'Footer menu bottom' , 'nav menu location', 'lighthouse')
14
+			)
15
+		);
16 16
 }
17 17
 
18 18
 add_action( 'init', 'lighthouse_menus' );
@@ -25,104 +25,104 @@  discard block
 block discarded – undo
25 25
 
26 26
 //Left menu
27 27
 function lighthouse_header_menu_left() {
28
-    if ( has_nav_menu( 'header-menu-left' ) ) {
29
-    wp_nav_menu(
30
-        array(
31
-            'theme_location'  => 'header-menu-left',
32
-            'menu'            => '',
33
-            'container'       => 'div',
34
-            'container_id'    => 'header-menu-left-id',
35
-            'container_class' => 'header-menu-left-cl',
36
-            'menu_id'         => 'header-menu-id',
37
-            'menu_class'      => 'header-menu-cl',
38
-            'echo'            => true,
39
-            'fallback_cb'     => '',
40
-            'before'          => '',
41
-            'after'           => '',
42
-            'link_before'     => '<span>',
43
-            'link_after'      => '</span>',
44
-            'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
45
-            'depth'           => 0,
46
-            'walker'          => ''
47
-        )
48
-    );
49
-    }
28
+	if ( has_nav_menu( 'header-menu-left' ) ) {
29
+	wp_nav_menu(
30
+		array(
31
+			'theme_location'  => 'header-menu-left',
32
+			'menu'            => '',
33
+			'container'       => 'div',
34
+			'container_id'    => 'header-menu-left-id',
35
+			'container_class' => 'header-menu-left-cl',
36
+			'menu_id'         => 'header-menu-id',
37
+			'menu_class'      => 'header-menu-cl',
38
+			'echo'            => true,
39
+			'fallback_cb'     => '',
40
+			'before'          => '',
41
+			'after'           => '',
42
+			'link_before'     => '<span>',
43
+			'link_after'      => '</span>',
44
+			'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
45
+			'depth'           => 0,
46
+			'walker'          => ''
47
+		)
48
+	);
49
+	}
50 50
 }
51 51
 
52 52
 //Right menu
53 53
 function lighthouse_header_menu_right() {
54
-    if ( has_nav_menu( 'header-menu-right' ) ) {
55
-    wp_nav_menu(
56
-        array(
57
-            'theme_location'  => 'header-menu-right',
58
-            'menu'            => '',
59
-            'container'       => 'div',
60
-            'container_id'    => 'header-menu-right-id',
61
-            'container_class' => 'header-menu-right-cl',
62
-            'menu_id'         => 'header-menu-id',
63
-            'menu_class'      => 'header-menu-cl',
64
-            'echo'            => true,
65
-            'fallback_cb'     => '',
66
-            'before'          => '',
67
-            'after'           => '',
68
-            'link_before'     => '<span>',
69
-            'link_after'      => '</span>',
70
-            'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
71
-            'depth'           => 0,
72
-            'walker'          => ''
73
-        )
74
-    );
75
-    }
54
+	if ( has_nav_menu( 'header-menu-right' ) ) {
55
+	wp_nav_menu(
56
+		array(
57
+			'theme_location'  => 'header-menu-right',
58
+			'menu'            => '',
59
+			'container'       => 'div',
60
+			'container_id'    => 'header-menu-right-id',
61
+			'container_class' => 'header-menu-right-cl',
62
+			'menu_id'         => 'header-menu-id',
63
+			'menu_class'      => 'header-menu-cl',
64
+			'echo'            => true,
65
+			'fallback_cb'     => '',
66
+			'before'          => '',
67
+			'after'           => '',
68
+			'link_before'     => '<span>',
69
+			'link_after'      => '</span>',
70
+			'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
71
+			'depth'           => 0,
72
+			'walker'          => ''
73
+		)
74
+	);
75
+	}
76 76
 }
77 77
 
78 78
 //Fotter menu
79 79
 function lighthouse_footer_menu() {
80
-    if ( has_nav_menu( 'footer-menu' ) ) {
81
-    wp_nav_menu(
82
-        array(
83
-            'theme_location'  => 'footer-menu',
84
-            'menu'            => '',
85
-            'container'       => 'div',
86
-            'container_id'    => 'footer-menu-id',
87
-            'container_class' => 'footer-menu-cl',
88
-            'menu_id'         => 'footer-menu-id',
89
-            'menu_class'      => 'footer-menu-cl',
90
-            'echo'            => true,
91
-            'fallback_cb'     => '',
92
-            'before'          => '',
93
-            'after'           => '',
94
-            'link_before'     => '',
95
-            'link_after'      => '',
96
-            'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
97
-            'depth'           => 0,
98
-            'walker'          => ''
99
-        )
100
-    );
101
-    }
80
+	if ( has_nav_menu( 'footer-menu' ) ) {
81
+	wp_nav_menu(
82
+		array(
83
+			'theme_location'  => 'footer-menu',
84
+			'menu'            => '',
85
+			'container'       => 'div',
86
+			'container_id'    => 'footer-menu-id',
87
+			'container_class' => 'footer-menu-cl',
88
+			'menu_id'         => 'footer-menu-id',
89
+			'menu_class'      => 'footer-menu-cl',
90
+			'echo'            => true,
91
+			'fallback_cb'     => '',
92
+			'before'          => '',
93
+			'after'           => '',
94
+			'link_before'     => '',
95
+			'link_after'      => '',
96
+			'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
97
+			'depth'           => 0,
98
+			'walker'          => ''
99
+		)
100
+	);
101
+	}
102 102
 }
103 103
 
104 104
 //Menu footer-bottom
105 105
 function lighthouse_footer_menu_bottom() {
106
-    if ( has_nav_menu( 'footer-menu-bottom' ) ) {
107
-    wp_nav_menu(
108
-        array(
109
-            'theme_location'  => 'footer-menu-bottom',
110
-            'menu'            => '',
111
-            'container'       => 'div',
112
-            'container_id'    => 'footer-menu-bottom-id',
113
-            'container_class' => 'footer-menu-bottom-cl',
114
-            'menu_id'         => 'footer-menu-id',
115
-            'menu_class'      => 'footer-menu-cl',
116
-            'echo'            => true,
117
-            'fallback_cb'     => '',
118
-            'before'          => '',
119
-            'after'           => '',
120
-            'link_before'     => '',
121
-            'link_after'      => '',
122
-            'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
123
-            'depth'           => 0,
124
-            'walker'          => ''
125
-        )
126
-    );
127
-    }
106
+	if ( has_nav_menu( 'footer-menu-bottom' ) ) {
107
+	wp_nav_menu(
108
+		array(
109
+			'theme_location'  => 'footer-menu-bottom',
110
+			'menu'            => '',
111
+			'container'       => 'div',
112
+			'container_id'    => 'footer-menu-bottom-id',
113
+			'container_class' => 'footer-menu-bottom-cl',
114
+			'menu_id'         => 'footer-menu-id',
115
+			'menu_class'      => 'footer-menu-cl',
116
+			'echo'            => true,
117
+			'fallback_cb'     => '',
118
+			'before'          => '',
119
+			'after'           => '',
120
+			'link_before'     => '',
121
+			'link_after'      => '',
122
+			'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
123
+			'depth'           => 0,
124
+			'walker'          => ''
125
+		)
126
+	);
127
+	}
128 128
 }
129 129
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
 function lighthouse_menus() {
8 8
     register_nav_menus(
9 9
         array(
10
-            'header-menu-left' => __( 'Header menu left', 'nav menu location', 'lighthouse' ),
11
-            'header-menu-right' => __( 'Header menu right' , 'nav menu location', 'lighthouse'),
12
-            'footer-menu' => __( 'Footer menu' , 'nav menu location', 'lighthouse'),
13
-            'footer-menu-bottom' => __( 'Footer menu bottom' , 'nav menu location', 'lighthouse')
10
+            'header-menu-left' => __('Header menu left', 'nav menu location', 'lighthouse'),
11
+            'header-menu-right' => __('Header menu right', 'nav menu location', 'lighthouse'),
12
+            'footer-menu' => __('Footer menu', 'nav menu location', 'lighthouse'),
13
+            'footer-menu-bottom' => __('Footer menu bottom', 'nav menu location', 'lighthouse')
14 14
             )
15 15
         );
16 16
 }
17 17
 
18
-add_action( 'init', 'lighthouse_menus' );
18
+add_action('init', 'lighthouse_menus');
19 19
 
20 20
 
21 21
 /*
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 //Left menu
27 27
 function lighthouse_header_menu_left() {
28
-    if ( has_nav_menu( 'header-menu-left' ) ) {
28
+    if (has_nav_menu('header-menu-left')) {
29 29
     wp_nav_menu(
30 30
         array(
31 31
             'theme_location'  => 'header-menu-left',
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 //Right menu
53 53
 function lighthouse_header_menu_right() {
54
-    if ( has_nav_menu( 'header-menu-right' ) ) {
54
+    if (has_nav_menu('header-menu-right')) {
55 55
     wp_nav_menu(
56 56
         array(
57 57
             'theme_location'  => 'header-menu-right',
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 //Fotter menu
79 79
 function lighthouse_footer_menu() {
80
-    if ( has_nav_menu( 'footer-menu' ) ) {
80
+    if (has_nav_menu('footer-menu')) {
81 81
     wp_nav_menu(
82 82
         array(
83 83
             'theme_location'  => 'footer-menu',
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 //Menu footer-bottom
105 105
 function lighthouse_footer_menu_bottom() {
106
-    if ( has_nav_menu( 'footer-menu-bottom' ) ) {
106
+    if (has_nav_menu('footer-menu-bottom')) {
107 107
     wp_nav_menu(
108 108
         array(
109 109
             'theme_location'  => 'footer-menu-bottom',
Please login to merge, or discard this patch.
includes/shortcodes.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,14 +3,14 @@  discard block
 block discarded – undo
3 3
 /**
4 4
  * Shortcode: Recent Post Slider
5 5
  */
6
-function recent_post_slider($atts, $content = null){
6
+function recent_post_slider($atts, $content = null) {
7 7
 
8 8
 	ob_start();
9 9
 
10 10
 	echo '<div class="post-slider row"><div id="recent-posts" class="owl-carousel">';
11 11
 
12 12
 	global $post;
13
-	$post_query = new WP_Query( array(
13
+	$post_query = new WP_Query(array(
14 14
 		'post_type' => 'post',
15 15
 		'posts_per_page' => 12,
16 16
 		'order'=>'DESC',
@@ -18,21 +18,21 @@  discard block
 block discarded – undo
18 18
 		)
19 19
 	);
20 20
 
21
-	if( $post_query->have_posts() ) : while( $post_query->have_posts() ) : $post_query->the_post();
22
-	$thumb_post = wp_get_attachment_image_src( get_post_thumbnail_id(), 'lighthouse_related_post');
21
+	if ($post_query->have_posts()) : while ($post_query->have_posts()) : $post_query->the_post();
22
+	$thumb_post = wp_get_attachment_image_src(get_post_thumbnail_id(), 'lighthouse_related_post');
23 23
 	$url_post = $thumb_post[0];
24 24
 	$content = get_the_content();
25 25
 
26 26
 	echo '<div class="col-xs-12"><div class="thumbnail thumbnail-hover">';
27
-	echo '<img class="img-responsive" src=" ' . $url_post . '">';
28
-	echo '<a href=" ' . get_permalink() .' " " title=" ' .  get_the_title() .' " class="overlay"></a>';
27
+	echo '<img class="img-responsive" src=" '.$url_post.'">';
28
+	echo '<a href=" '.get_permalink().' " " title=" '.get_the_title().' " class="overlay"></a>';
29 29
 	echo '</div>';
30 30
 	echo '<div class="entry">';
31
-	echo '<h3><a href=" ' . get_permalink() . ' "> ' . get_the_title() . '</a></h3>';
32
-	echo '<span class="date"> <i class="fa fa-clock-o"></i> ' . get_the_time(get_option('date_format')) .'</span>';
33
-	echo '<div class="entry-content">' . wp_trim_words( $content , '27' ) . '</div>';
31
+	echo '<h3><a href=" '.get_permalink().' "> '.get_the_title().'</a></h3>';
32
+	echo '<span class="date"> <i class="fa fa-clock-o"></i> '.get_the_time(get_option('date_format')).'</span>';
33
+	echo '<div class="entry-content">'.wp_trim_words($content, '27').'</div>';
34 34
 	echo '<div class="read-more">';
35
-	echo '<a href="' . get_permalink() . ' " class="btn read-more-btn">View Article</a>';
35
+	echo '<a href="'.get_permalink().' " class="btn read-more-btn">View Article</a>';
36 36
 	echo '</div>';
37 37
 	echo '</div></div>';
38 38
 
@@ -46,26 +46,26 @@  discard block
 block discarded – undo
46 46
 	return $output;
47 47
 }
48 48
 
49
-add_shortcode('recent_posts','recent_post_slider');
49
+add_shortcode('recent_posts', 'recent_post_slider');
50 50
 
51 51
 
52 52
 /**
53 53
  * Shortcode: Recent Post Slider
54 54
  */
55
-function member_logo_slider($atts, $content = null){
55
+function member_logo_slider($atts, $content = null) {
56 56
 
57 57
 	ob_start();
58 58
 
59 59
 	echo '<div class="members-logo row"> <div id="logo-slider" class="owl-carousel">';
60 60
 
61
-	if( have_rows('members_logo', 'option') ):
62
-		while ( have_rows('members_logo', 'option') ) : the_row();
61
+	if (have_rows('members_logo', 'option')):
62
+		while (have_rows('members_logo', 'option')) : the_row();
63 63
 	$logo_url = get_sub_field('logo');
64 64
 	$company_link = get_sub_field('link');
65 65
 
66 66
 	echo '<div class="thumbnail thumbnail-hover">';
67
-	echo '<img class="img-responsive" src=" ' . $logo_url . '">';
68
-	echo '<a href=" ' . $company_link .' " " title=" ' .  $company_link .' " class="link-full"></a>';
67
+	echo '<img class="img-responsive" src=" '.$logo_url.'">';
68
+	echo '<a href=" '.$company_link.' " " title=" '.$company_link.' " class="link-full"></a>';
69 69
 	echo '</div>';
70 70
 
71 71
 
@@ -82,4 +82,4 @@  discard block
 block discarded – undo
82 82
 	
83 83
 }
84 84
 
85
-add_shortcode('members_logo','member_logo_slider');
86 85
\ No newline at end of file
86
+add_shortcode('members_logo', 'member_logo_slider');
87 87
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,10 @@
 block discarded – undo
71 71
 
72 72
 
73 73
 	endwhile;
74
-	else :
75
-		echo '<div class="col-xs-12">Members Logo Slider not found! <be> please add some logo in theme setting page</div>';
74
+	else {
75
+		:
76
+		echo '<div class="col-xs-12">Members Logo Slider not found! <be> please add some logo in theme setting page</div>';
77
+	}
76 78
 	endif;
77 79
 	echo '</div></div>';
78 80
 
Please login to merge, or discard this patch.
includes/theme-settings.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -64,31 +64,31 @@
 block discarded – undo
64 64
  */
65 65
 function tinymce_settings( $settings ) {
66 66
 
67
-    // html elements being stripped
67
+	// html elements being stripped
68 68
 	$settings['extended_valid_elements'] = 'div[*],article[*]';
69 69
 
70
-    // only html elements to keep
71
-    //$settings['valid_elements'] = 'a,strong/b,div,h1,h2,h3,section';
70
+	// only html elements to keep
71
+	//$settings['valid_elements'] = 'a,strong/b,div,h1,h2,h3,section';
72 72
 
73 73
 	// paste elements to keep
74 74
 	//$opts = '*[*]';
75 75
 	//$settings['paste_word_valid_elements'] = $opts;
76 76
 
77
-    // don't remove line breaks
77
+	// don't remove line breaks
78 78
 	$settings['remove_linebreaks'] = false;
79 79
 
80 80
 	$settings['allow_html_in_named_anchor'] = true;
81 81
 
82
-    // convert newline characters to BR
82
+	// convert newline characters to BR
83 83
 	$settings['convert_newlines_to_brs'] = true;
84 84
 
85
-    // don't remove redundant BR
85
+	// don't remove redundant BR
86 86
 	$settings['remove_redundant_brs'] = false;
87 87
 
88 88
 	// only html elements to keep
89 89
 	//$settings['wpautop'] = false;
90 90
 
91
-    // pass back to wordpress
91
+	// pass back to wordpress
92 92
 
93 93
 	return $settings;
94 94
 }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@  discard block
 block discarded – undo
3 3
 /**
4 4
  * Read More button in excerpt
5 5
  */
6
-function new_excerpt_more( $more ) {
7
-	return '... <a class="readmore" href="' . get_permalink() . ' ">Read more <i class="fa fa-external-link"></i></a>';
6
+function new_excerpt_more($more) {
7
+	return '... <a class="readmore" href="'.get_permalink().' ">Read more <i class="fa fa-external-link"></i></a>';
8 8
 }
9 9
 
10
-add_filter( 'excerpt_more', 'new_excerpt_more' );
10
+add_filter('excerpt_more', 'new_excerpt_more');
11 11
 
12 12
 /**
13 13
  * Custome Lenght of excerpt
@@ -23,37 +23,37 @@  discard block
 block discarded – undo
23 23
  */
24 24
 function pagination($pages = '', $range = 4)
25 25
 {  
26
-	$showitems = ($range * 2)+1;  
26
+	$showitems = ($range * 2) + 1;  
27 27
 
28 28
 	global $paged;
29
-	if(empty($paged)) $paged = 1;
29
+	if (empty($paged)) $paged = 1;
30 30
 
31
-	if($pages == '')
31
+	if ($pages == '')
32 32
 	{
33 33
 		global $wp_query;
34 34
 		$pages = $wp_query->max_num_pages;
35
-		if(!$pages)
35
+		if ( ! $pages)
36 36
 		{
37 37
 			$pages = 1;
38 38
 		}
39 39
 	}   
40 40
 
41
-	if(1 != $pages)
41
+	if (1 != $pages)
42 42
 	{
43 43
 		echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>";
44
-		if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo; First</a>";
45
-		if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo; Previous</a>";
44
+		if ($paged > 2 && $paged > $range + 1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo; First</a>";
45
+		if ($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo; Previous</a>";
46 46
 
47
-		for ($i=1; $i <= $pages; $i++)
47
+		for ($i = 1; $i <= $pages; $i++)
48 48
 		{
49
-			if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
49
+			if (1 != $pages && ( ! ($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems))
50 50
 			{
51
-				echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>";
51
+				echo ($paged == $i) ? "<span class=\"current\">".$i."</span>" : "<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>";
52 52
 			}
53 53
 		}
54 54
 
55 55
 		if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next &rsaquo;</a>";  
56
-		if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last &raquo;</a>";
56
+		if ($paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last &raquo;</a>";
57 57
 		echo "</div>\n";
58 58
 	}
59 59
 }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 /**
63 63
  * stop wp removing div tags
64 64
  */
65
-function tinymce_settings( $settings ) {
65
+function tinymce_settings($settings) {
66 66
 
67 67
     // html elements being stripped
68 68
 	$settings['extended_valid_elements'] = 'div[*],article[*]';
@@ -93,4 +93,4 @@  discard block
 block discarded – undo
93 93
 	return $settings;
94 94
 }
95 95
 
96
-add_filter( 'tiny_mce_before_init', 'tinymce_settings' );
97 96
\ No newline at end of file
97
+add_filter('tiny_mce_before_init', 'tinymce_settings');
98 98
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@  discard block
 block discarded – undo
26 26
 	$showitems = ($range * 2)+1;  
27 27
 
28 28
 	global $paged;
29
-	if(empty($paged)) $paged = 1;
29
+	if(empty($paged)) {
30
+		$paged = 1;
31
+	}
30 32
 
31 33
 	if($pages == '')
32 34
 	{
@@ -41,8 +43,12 @@  discard block
 block discarded – undo
41 43
 	if(1 != $pages)
42 44
 	{
43 45
 		echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>";
44
-		if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo; First</a>";
45
-		if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo; Previous</a>";
46
+		if($paged > 2 && $paged > $range+1 && $showitems < $pages) {
47
+			echo "<a href='".get_pagenum_link(1)."'>&laquo; First</a>";
48
+		}
49
+		if($paged > 1 && $showitems < $pages) {
50
+			echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo; Previous</a>";
51
+		}
46 52
 
47 53
 		for ($i=1; $i <= $pages; $i++)
48 54
 		{
@@ -52,8 +58,12 @@  discard block
 block discarded – undo
52 58
 			}
53 59
 		}
54 60
 
55
-		if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next &rsaquo;</a>";  
56
-		if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last &raquo;</a>";
61
+		if ($paged < $pages && $showitems < $pages) {
62
+			echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next &rsaquo;</a>";
63
+		}
64
+		if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) {
65
+			echo "<a href='".get_pagenum_link($pages)."'>Last &raquo;</a>";
66
+		}
57 67
 		echo "</div>\n";
58 68
 	}
59 69
 }
Please login to merge, or discard this patch.
includes/widgets.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -3,76 +3,76 @@
 block discarded – undo
3 3
  Sidebar widget area (theme default).
4 4
 **/
5 5
 function lighthouse_widgets_init() {
6
-	register_sidebar( array(
7
-		'name'          => esc_html__( 'Sidebar', 'lighthouse' ),
6
+	register_sidebar(array(
7
+		'name'          => esc_html__('Sidebar', 'lighthouse'),
8 8
 		'id'            => 'sidebar-1',
9 9
 		'description'   => '',
10 10
 		'before_widget' => '<section id="%1$s" class="widget %2$s">',
11 11
 		'after_widget'  => '</section>',
12 12
 		'before_title'  => '<h2 class="widget-title">',
13 13
 		'after_title'   => '</h2>',
14
-		) );
14
+		));
15 15
 }
16 16
 
17
-add_action( 'widgets_init', 'lighthouse_widgets_init' );
17
+add_action('widgets_init', 'lighthouse_widgets_init');
18 18
 
19 19
 
20 20
 //Footer widgets
21 21
 function footer_widgets_init() {
22 22
 
23
-	register_sidebar( array(
23
+	register_sidebar(array(
24 24
 		'name' => 'Footer Widgets #1',
25
-		'description'   => __( 'Widgets displayed at footer.', 'lighthouse' ),
25
+		'description'   => __('Widgets displayed at footer.', 'lighthouse'),
26 26
 		'id' => 'footer_widgets_1',
27 27
 		'before_widget' => '<div id="%1$s" class="widget %2$s">',
28 28
 		'after_widget' => '</div>',
29 29
 		'before_title' => '<h3 class="widget-title">',
30 30
 		'after_title' => '</h3>',
31
-	) );
32
-		register_sidebar( array(
31
+	));
32
+		register_sidebar(array(
33 33
 		'name' => 'Footer Widgets #2',
34
-		'description'   => __( 'Widgets displayed at footer.', 'lighthouse' ),
34
+		'description'   => __('Widgets displayed at footer.', 'lighthouse'),
35 35
 		'id' => 'footer_widgets_2',
36 36
 		'before_widget' => '<div id="%1$s" class="widget %2$s">',
37 37
 		'after_widget' => '</div>',
38 38
 		'before_title' => '<h3 class="widget-title">',
39 39
 		'after_title' => '</h3>',
40
-	) );
41
-		register_sidebar( array(
40
+	));
41
+		register_sidebar(array(
42 42
 		'name' => 'Footer Widgets #3',
43
-		'description'   => __( 'Widgets displayed at footer.', 'lighthouse' ),
43
+		'description'   => __('Widgets displayed at footer.', 'lighthouse'),
44 44
 		'id' => 'footer_widgets_3',
45 45
 		'before_widget' => '<div id="%1$s" class="widget %2$s">',
46 46
 		'after_widget' => '</div>',
47 47
 		'before_title' => '<h3 class="widget-title">',
48 48
 		'after_title' => '</h3>',
49
-	) );
50
-		register_sidebar( array(
49
+	));
50
+		register_sidebar(array(
51 51
 		'name' => 'Footer Widgets #4',
52
-		'description'   => __( 'Widgets displayed at footer.', 'lighthouse' ),
52
+		'description'   => __('Widgets displayed at footer.', 'lighthouse'),
53 53
 		'id' => 'footer_widgets_4',
54 54
 		'before_widget' => '<div id="%1$s" class="widget %2$s">',
55 55
 		'after_widget' => '</div>',
56 56
 		'before_title' => '<h3 class="widget-title">',
57 57
 		'after_title' => '</h3>',
58
-	) );
58
+	));
59 59
 }
60 60
 
61
-add_action( 'widgets_init', 'footer_widgets_init' );
61
+add_action('widgets_init', 'footer_widgets_init');
62 62
 
63 63
 
64 64
 //Blog sidebar widgets
65 65
 function blog_widgets_init() {
66 66
 
67
-		register_sidebar( array(
67
+		register_sidebar(array(
68 68
 		'name' => 'Blog Sidebar',
69
-		'description'   => __( 'Widgets displayed at blog page.', 'lighthouse' ),
69
+		'description'   => __('Widgets displayed at blog page.', 'lighthouse'),
70 70
 		'id' => 'blog_widgets',
71 71
 		'before_widget' => '<div id="%1$s" class="widget %2$s">',
72 72
 		'after_widget' => '</div>',
73 73
 		'before_title' => '<h3 class="widget-title">',
74 74
 		'after_title' => '</h3>',
75
-	) );
75
+	));
76 76
 }
77 77
 
78
-add_action( 'widgets_init', 'blog_widgets_init' );
79 78
\ No newline at end of file
79
+add_action('widgets_init', 'blog_widgets_init');
80 80
\ No newline at end of file
Please login to merge, or discard this patch.
page-template/backup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 <div class="container full-width">
3 3
 	<div class="row">
4 4
 		<main id="main" class="site-main" role="main">
5
-			<?php while ( have_posts() ) : the_post(); ?>
5
+			<?php while (have_posts()) : the_post(); ?>
6 6
 				<div class="sections">
7 7
 					<?php //the_content(); ?>
8 8
 
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 <div class="row">
13 13
 <div class="col-xs-12">
14 14
 <div class="slider-inner">
15
-<?php echo do_shortcode( '[masterslider id="1"]') ?>
15
+<?php echo do_shortcode('[masterslider id="1"]') ?>
16 16
 </div>
17 17
 <div class="messages">
18 18
 <p>Latest Financial Reports just added - View our 2016 Accounts here +</p>
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		<div class="col-xs-12">
186 186
 		<h4>Members of the following groups, see how we already work with you:</h4>
187 187
 
188
-		<?php echo do_shortcode( '[members_logo]') ?>
188
+		<?php echo do_shortcode('[members_logo]') ?>
189 189
 		</div>
190 190
 	</div>
191 191
 </div>
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	</div>
204 204
 	<div class="row">
205 205
 	<div class="col-xs-12">
206
-	<?php echo do_shortcode( '[recent_posts]') ?>
206
+	<?php echo do_shortcode('[recent_posts]') ?>
207 207
 	</div>
208 208
 	</div>
209 209
 </section>
Please login to merge, or discard this patch.
page-template/blog.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	<div class="container blog-wrapper">
10 10
 		<div class="row">
11 11
 			<div class="col-xs-12 content-header">
12
-				<?php the_title( '<h1>', '</h1>' ); ?>
12
+				<?php the_title('<h1>', '</h1>'); ?>
13 13
 				<h4>Read the latest articles, commentary in our news blogs</h4>
14 14
 			</div>
15 15
 		</div>
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 	<div class="row">
20 20
 		<div class="col-md-9 content-listing">
21 21
 			<?php 
22
-			$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
22
+			$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
23 23
 			$args = array(
24 24
 				'post_type' => 'post',
25 25
 				'posts_per_page' => 6,
26 26
 				'paged' => $paged
27 27
 				);
28
-			$loop = new WP_Query( $args );
29
-			while($loop->have_posts()) : $loop->the_post();	
28
+			$loop = new WP_Query($args);
29
+			while ($loop->have_posts()) : $loop->the_post();	
30 30
 
31 31
 			$postid = get_the_ID();
32 32
 			?>
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 			<article id="post-<?php echo $postid; ?>">
35 35
 				<div class="row blog-item">
36 36
 					<?php
37
-					$thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'lighthouse_blog_listing');
37
+					$thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'lighthouse_blog_listing');
38 38
 					$url = $thumb[0];
39 39
 					$content = get_the_content();
40 40
 					?>
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 								<span class="date"><?php the_time(get_option('date_format')) ?></span>
54 54
 							</div>
55 55
 							<div class="entry-content">
56
-								<?php echo wp_trim_words( $content , '18' ) ?>
56
+								<?php echo wp_trim_words($content, '18') ?>
57 57
 							</div>
58 58
 							<div class="read-more">
59 59
 								<a href="<?php the_permalink() ?>" class="btn read-more-btn">Read More</a>
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	</div>
75 75
 </div>
76 76
 <div class="col-md-3 sidebar" role="complementary">
77
-	<?php dynamic_sidebar( 'blog_widgets' ); ?>
77
+	<?php dynamic_sidebar('blog_widgets'); ?>
78 78
 </div>
79 79
 </div><!-- .row -->
80 80
 </div><!-- .container -->
Please login to merge, or discard this patch.
page-template/page-advice.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template Name: Advice
4
- *
5
- * @package Lighthouse
6
- */
3
+		 * Template Name: Advice
4
+		 *
5
+		 * @package Lighthouse
6
+		 */
7 7
 get_header(); ?>
8 8
 
9 9
 <div class="container full-width">
Please login to merge, or discard this patch.
page-template/page-home.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 <div class="container full-width">
10 10
 	<div class="row">
11 11
 		<main id="main" class="site-main" role="main">
12
-			<?php while ( have_posts() ) : the_post(); ?>
12
+			<?php while (have_posts()) : the_post(); ?>
13 13
 				<div class="sections">
14 14
 					<?php //the_content(); ?>
15 15
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 <div class="row">
20 20
 <div class="col-xs-12">
21 21
 <div class="slider-inner">
22
-<?php echo do_shortcode( '[masterslider id="1"]') ?>
22
+<?php echo do_shortcode('[masterslider id="1"]') ?>
23 23
 </div>
24 24
 <div class="messages">
25 25
 <p>Latest Financial Reports just added - View our 2016 Accounts here +</p>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		<div class="col-xs-12">
193 193
 		<h4>Members of the following groups, see how we already work with you:</h4>
194 194
 
195
-		<?php echo do_shortcode( '[members_logo]') ?>
195
+		<?php echo do_shortcode('[members_logo]') ?>
196 196
 		</div>
197 197
 	</div>
198 198
 </div>
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	</div>
211 211
 	<div class="row">
212 212
 	<div class="col-xs-12">
213
-	<?php echo do_shortcode( '[recent_posts]') ?>
213
+	<?php echo do_shortcode('[recent_posts]') ?>
214 214
 	</div>
215 215
 	</div>
216 216
 </section>
Please login to merge, or discard this patch.