Skip to content

Commit

Permalink
Update for new Sage 10 directory structure
Browse files Browse the repository at this point in the history
Closes #6
  • Loading branch information
catgofire authored Jan 29, 2021
1 parent ea7e0a0 commit c88b4cb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions advanced-custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@
if (is_dir(get_stylesheet_directory() . '/assets')) {
// This is Sage 9
$path = get_stylesheet_directory() . '/assets/acf-json';
} else {
// This is Sage 10
} elseif (is_dir(get_stylesheet_directory() . '/resources/assets')) {
// This is old Sage 10
$path = get_stylesheet_directory() . '/resources/assets/acf-json';
} elseif (is_dir(get_stylesheet_directory() . '/resources')) {
// This is Sage 10
$path = get_stylesheet_directory() . '/resources/acf-json';
} else {
// This probably isn't Sage
$path = get_stylesheet_directory() . '/acf-json';
}

// If the directory doesn't exist, create it.
Expand All @@ -48,9 +54,15 @@
// Sage 9 path
$paths[] = get_stylesheet_directory() . '/assets/acf-json';

// Sage 10 path
// old Sage 10 path
$paths[] = get_stylesheet_directory() . '/resources/assets/acf-json';

// Sage 10 path
$paths[] = get_stylesheet_directory() . '/resources/acf-json';

// Failsafe path
$paths[] = get_stylesheet_directory() . '/acf-json';

// return
return $paths;
});
Expand Down

0 comments on commit c88b4cb

Please sign in to comment.