@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The main template file. |
|
4 | - * |
|
5 | - * This is the most generic template file in a WordPress theme |
|
6 | - * and one of the two required files for a theme (the other being style.css). |
|
7 | - * It is used to display a page when nothing more specific matches a query. |
|
8 | - * E.g., it puts together the home page when no home.php file exists. |
|
9 | - * |
|
10 | - * @link https://codex.wordpress.org/Template_Hierarchy |
|
11 | - * |
|
12 | - * @package Lighthouse |
|
13 | - */ |
|
3 | + * The main template file. |
|
4 | + * |
|
5 | + * This is the most generic template file in a WordPress theme |
|
6 | + * and one of the two required files for a theme (the other being style.css). |
|
7 | + * It is used to display a page when nothing more specific matches a query. |
|
8 | + * E.g., it puts together the home page when no home.php file exists. |
|
9 | + * |
|
10 | + * @link https://codex.wordpress.org/Template_Hierarchy |
|
11 | + * |
|
12 | + * @package Lighthouse |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | get_header(); ?> |
16 | 16 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The header for our theme. |
|
4 | - * |
|
5 | - * This is the template that displays all of the <head> section and everything up until <div id="content"> |
|
6 | - * |
|
7 | - * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials |
|
8 | - * |
|
9 | - * @package Lighthouse |
|
10 | - */ |
|
3 | + * The header for our theme. |
|
4 | + * |
|
5 | + * This is the template that displays all of the <head> section and everything up until <div id="content"> |
|
6 | + * |
|
7 | + * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials |
|
8 | + * |
|
9 | + * @package Lighthouse |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | ?><!DOCTYPE html> |
13 | 13 | <html <?php language_attributes(); ?>> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying 404 pages (not found). |
|
4 | - * |
|
5 | - * @link https://codex.wordpress.org/Creating_an_Error_404_Page |
|
6 | - * |
|
7 | - * @package Lighthouse |
|
8 | - */ |
|
3 | + * The template for displaying 404 pages (not found). |
|
4 | + * |
|
5 | + * @link https://codex.wordpress.org/Creating_an_Error_404_Page |
|
6 | + * |
|
7 | + * @package Lighthouse |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template part for displaying a message that posts cannot be found. |
|
4 | - * |
|
5 | - * @link https://codex.wordpress.org/Template_Hierarchy |
|
6 | - * |
|
7 | - * @package Lighthouse |
|
8 | - */ |
|
3 | + * Template part for displaying a message that posts cannot be found. |
|
4 | + * |
|
5 | + * @link https://codex.wordpress.org/Template_Hierarchy |
|
6 | + * |
|
7 | + * @package Lighthouse |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | ?> |
11 | 11 |
@@ -8,11 +8,11 @@ discard block |
||
8 | 8 | |
9 | 9 | function my_acf_settings_path( $path ) { |
10 | 10 | |
11 | - // update path |
|
12 | - $path = get_stylesheet_directory() . '/includes/acf/'; |
|
11 | + // update path |
|
12 | + $path = get_stylesheet_directory() . '/includes/acf/'; |
|
13 | 13 | |
14 | - // return |
|
15 | - return $path; |
|
14 | + // return |
|
15 | + return $path; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | // Customize ACF dir |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | |
21 | 21 | function my_acf_settings_dir( $dir ) { |
22 | 22 | |
23 | - // update path |
|
24 | - $dir = get_stylesheet_directory_uri() . '/includes/acf/'; |
|
23 | + // update path |
|
24 | + $dir = get_stylesheet_directory_uri() . '/includes/acf/'; |
|
25 | 25 | |
26 | - // return |
|
27 | - return $dir; |
|
26 | + // return |
|
27 | + return $dir; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | // Save ACF field as JSON |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | |
33 | 33 | function my_acf_json_save_point( $path ) { |
34 | 34 | |
35 | - // update path |
|
36 | - $path = get_stylesheet_directory() . '/includes/acf-json'; |
|
35 | + // update path |
|
36 | + $path = get_stylesheet_directory() . '/includes/acf-json'; |
|
37 | 37 | |
38 | - // return |
|
39 | - return $path; |
|
38 | + // return |
|
39 | + return $path; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | // Load ACF field from JSON |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | |
45 | 45 | function my_acf_json_load_point( $paths ) { |
46 | 46 | |
47 | - // remove original path (optional) |
|
48 | - unset($paths[0]); |
|
47 | + // remove original path (optional) |
|
48 | + unset($paths[0]); |
|
49 | 49 | |
50 | - // append path |
|
51 | - $paths[] = get_stylesheet_directory() . '/includes/acf-json'; |
|
50 | + // append path |
|
51 | + $paths[] = get_stylesheet_directory() . '/includes/acf-json'; |
|
52 | 52 | |
53 | - // return |
|
54 | - return $paths; |
|
53 | + // return |
|
54 | + return $paths; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 |
@@ -263,16 +263,16 @@ discard block |
||
263 | 263 | // register post type 'acf-field-group' |
264 | 264 | register_post_type('acf-field-group', array( |
265 | 265 | 'labels' => array( |
266 | - 'name' => __( 'Field Groups', 'acf' ), |
|
266 | + 'name' => __( 'Field Groups', 'acf' ), |
|
267 | 267 | 'singular_name' => __( 'Field Group', 'acf' ), |
268 | - 'add_new' => __( 'Add New' , 'acf' ), |
|
269 | - 'add_new_item' => __( 'Add New Field Group' , 'acf' ), |
|
270 | - 'edit_item' => __( 'Edit Field Group' , 'acf' ), |
|
271 | - 'new_item' => __( 'New Field Group' , 'acf' ), |
|
272 | - 'view_item' => __( 'View Field Group', 'acf' ), |
|
273 | - 'search_items' => __( 'Search Field Groups', 'acf' ), |
|
274 | - 'not_found' => __( 'No Field Groups found', 'acf' ), |
|
275 | - 'not_found_in_trash' => __( 'No Field Groups found in Trash', 'acf' ), |
|
268 | + 'add_new' => __( 'Add New' , 'acf' ), |
|
269 | + 'add_new_item' => __( 'Add New Field Group' , 'acf' ), |
|
270 | + 'edit_item' => __( 'Edit Field Group' , 'acf' ), |
|
271 | + 'new_item' => __( 'New Field Group' , 'acf' ), |
|
272 | + 'view_item' => __( 'View Field Group', 'acf' ), |
|
273 | + 'search_items' => __( 'Search Field Groups', 'acf' ), |
|
274 | + 'not_found' => __( 'No Field Groups found', 'acf' ), |
|
275 | + 'not_found_in_trash' => __( 'No Field Groups found in Trash', 'acf' ), |
|
276 | 276 | ), |
277 | 277 | 'public' => false, |
278 | 278 | 'show_ui' => true, |
@@ -295,16 +295,16 @@ discard block |
||
295 | 295 | // register post type 'acf-field' |
296 | 296 | register_post_type('acf-field', array( |
297 | 297 | 'labels' => array( |
298 | - 'name' => __( 'Fields', 'acf' ), |
|
298 | + 'name' => __( 'Fields', 'acf' ), |
|
299 | 299 | 'singular_name' => __( 'Field', 'acf' ), |
300 | - 'add_new' => __( 'Add New' , 'acf' ), |
|
301 | - 'add_new_item' => __( 'Add New Field' , 'acf' ), |
|
302 | - 'edit_item' => __( 'Edit Field' , 'acf' ), |
|
303 | - 'new_item' => __( 'New Field' , 'acf' ), |
|
304 | - 'view_item' => __( 'View Field', 'acf' ), |
|
305 | - 'search_items' => __( 'Search Fields', 'acf' ), |
|
306 | - 'not_found' => __( 'No Fields found', 'acf' ), |
|
307 | - 'not_found_in_trash' => __( 'No Fields found in Trash', 'acf' ), |
|
300 | + 'add_new' => __( 'Add New' , 'acf' ), |
|
301 | + 'add_new_item' => __( 'Add New Field' , 'acf' ), |
|
302 | + 'edit_item' => __( 'Edit Field' , 'acf' ), |
|
303 | + 'new_item' => __( 'New Field' , 'acf' ), |
|
304 | + 'view_item' => __( 'View Field', 'acf' ), |
|
305 | + 'search_items' => __( 'Search Fields', 'acf' ), |
|
306 | + 'not_found' => __( 'No Fields found', 'acf' ), |
|
307 | + 'not_found_in_trash' => __( 'No Fields found in Trash', 'acf' ), |
|
308 | 308 | ), |
309 | 309 | 'public' => false, |
310 | 310 | 'show_ui' => false, |
@@ -413,27 +413,27 @@ discard block |
||
413 | 413 | |
414 | 414 | $where .= $wpdb->prepare(" AND {$wpdb->posts}.post_name = %s", $field_key ); |
415 | 415 | |
416 | - } |
|
416 | + } |
|
417 | 417 | |
418 | 418 | |
419 | - // acf_field_name |
|
420 | - if( $field_name = $wp_query->get('acf_field_name') ) { |
|
419 | + // acf_field_name |
|
420 | + if( $field_name = $wp_query->get('acf_field_name') ) { |
|
421 | 421 | |
422 | 422 | $where .= $wpdb->prepare(" AND {$wpdb->posts}.post_excerpt = %s", $field_name ); |
423 | 423 | |
424 | - } |
|
424 | + } |
|
425 | 425 | |
426 | 426 | |
427 | - // acf_group_key |
|
427 | + // acf_group_key |
|
428 | 428 | if( $group_key = $wp_query->get('acf_group_key') ) { |
429 | 429 | |
430 | 430 | $where .= $wpdb->prepare(" AND {$wpdb->posts}.post_name = %s", $group_key ); |
431 | 431 | |
432 | - } |
|
432 | + } |
|
433 | 433 | |
434 | 434 | |
435 | - // return |
|
436 | - return $where; |
|
435 | + // return |
|
436 | + return $where; |
|
437 | 437 | |
438 | 438 | } |
439 | 439 |
@@ -282,13 +282,13 @@ discard block |
||
282 | 282 | |
283 | 283 | |
284 | 284 | // append |
285 | - $html .= '<div id="acf-append-show-on-screen" class="acf-hidden">'; |
|
286 | - $html .= '<label for="acf-field-key-hide"><input id="acf-field-key-hide" type="checkbox" value="1" name="show_field_keys" ' . $checked . ' /> ' . __('Field Keys','acf') . '</label>'; |
|
285 | + $html .= '<div id="acf-append-show-on-screen" class="acf-hidden">'; |
|
286 | + $html .= '<label for="acf-field-key-hide"><input id="acf-field-key-hide" type="checkbox" value="1" name="show_field_keys" ' . $checked . ' /> ' . __('Field Keys','acf') . '</label>'; |
|
287 | 287 | $html .= '</div>'; |
288 | 288 | |
289 | 289 | |
290 | - // return |
|
291 | - return $html; |
|
290 | + // return |
|
291 | + return $html; |
|
292 | 292 | |
293 | 293 | } |
294 | 294 | |
@@ -396,9 +396,9 @@ discard block |
||
396 | 396 | // only save once! WordPress save's a revision as well. |
397 | 397 | if( wp_is_post_revision($post_id) ) { |
398 | 398 | |
399 | - return $post_id; |
|
399 | + return $post_id; |
|
400 | 400 | |
401 | - } |
|
401 | + } |
|
402 | 402 | |
403 | 403 | |
404 | 404 | // verify nonce |
@@ -409,11 +409,11 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | |
412 | - // disable local to avoid conflicts between DB and local |
|
412 | + // disable local to avoid conflicts between DB and local |
|
413 | 413 | acf_disable_local(); |
414 | 414 | |
415 | 415 | |
416 | - // save fields |
|
416 | + // save fields |
|
417 | 417 | unset( $_POST['acf_fields']['acfcloneindex'] ); |
418 | 418 | |
419 | 419 | if( !empty($_POST['acf_fields']) ) { |
@@ -453,10 +453,10 @@ discard block |
||
453 | 453 | |
454 | 454 | |
455 | 455 | // delete fields |
456 | - if( $_POST['_acf_delete_fields'] ) { |
|
456 | + if( $_POST['_acf_delete_fields'] ) { |
|
457 | 457 | |
458 | - $ids = explode('|', $_POST['_acf_delete_fields']); |
|
459 | - $ids = array_map( 'intval', $ids ); |
|
458 | + $ids = explode('|', $_POST['_acf_delete_fields']); |
|
459 | + $ids = array_map( 'intval', $ids ); |
|
460 | 460 | |
461 | 461 | foreach( $ids as $id ) { |
462 | 462 | |
@@ -468,20 +468,20 @@ discard block |
||
468 | 468 | |
469 | 469 | } |
470 | 470 | |
471 | - } |
|
471 | + } |
|
472 | 472 | |
473 | 473 | |
474 | 474 | // add args |
475 | - $_POST['acf_field_group']['ID'] = $post_id; |
|
476 | - $_POST['acf_field_group']['title'] = $_POST['post_title']; |
|
475 | + $_POST['acf_field_group']['ID'] = $post_id; |
|
476 | + $_POST['acf_field_group']['title'] = $_POST['post_title']; |
|
477 | 477 | |
478 | 478 | |
479 | 479 | // save field group |
480 | - acf_update_field_group( $_POST['acf_field_group'] ); |
|
480 | + acf_update_field_group( $_POST['acf_field_group'] ); |
|
481 | 481 | |
482 | 482 | |
483 | - // return |
|
484 | - return $post_id; |
|
483 | + // return |
|
484 | + return $post_id; |
|
485 | 485 | } |
486 | 486 | |
487 | 487 |
@@ -568,8 +568,8 @@ discard block |
||
568 | 568 | |
569 | 569 | } |
570 | 570 | |
571 | - // status |
|
572 | - } elseif( $column == 'acf-fg-status' ) { |
|
571 | + // status |
|
572 | + } elseif( $column == 'acf-fg-status' ) { |
|
573 | 573 | |
574 | 574 | if( isset($this->sync[ $field_group['key'] ]) ) { |
575 | 575 | |
@@ -587,12 +587,12 @@ discard block |
||
587 | 587 | |
588 | 588 | } |
589 | 589 | |
590 | - // fields |
|
591 | - } elseif( $column == 'acf-fg-count' ) { |
|
590 | + // fields |
|
591 | + } elseif( $column == 'acf-fg-count' ) { |
|
592 | 592 | |
593 | 593 | echo acf_get_field_count( $field_group ); |
594 | 594 | |
595 | - } |
|
595 | + } |
|
596 | 596 | |
597 | 597 | } |
598 | 598 |
@@ -79,17 +79,17 @@ |
||
79 | 79 | |
80 | 80 | |
81 | 81 | // load json |
82 | - $request = wp_remote_post( 'http://assets.advancedcustomfields.com/add-ons/add-ons.json' ); |
|
83 | - |
|
84 | - // validate |
|
85 | - if( is_wp_error($request) || wp_remote_retrieve_response_code($request) != 200) |
|
86 | - { |
|
87 | - acf_add_admin_notice(__('<b>Error</b>. Could not load add-ons list', 'acf'), 'error'); |
|
88 | - } |
|
89 | - else |
|
90 | - { |
|
91 | - $this->view['json'] = json_decode( $request['body'], true ); |
|
92 | - } |
|
82 | + $request = wp_remote_post( 'http://assets.advancedcustomfields.com/add-ons/add-ons.json' ); |
|
83 | + |
|
84 | + // validate |
|
85 | + if( is_wp_error($request) || wp_remote_retrieve_response_code($request) != 200) |
|
86 | + { |
|
87 | + acf_add_admin_notice(__('<b>Error</b>. Could not load add-ons list', 'acf'), 'error'); |
|
88 | + } |
|
89 | + else |
|
90 | + { |
|
91 | + $this->view['json'] = json_decode( $request['body'], true ); |
|
92 | + } |
|
93 | 93 | |
94 | 94 | } |
95 | 95 |