diff --git a/advanced-custom-fields.php b/advanced-custom-fields.php index 56b8c24..a698223 100644 --- a/advanced-custom-fields.php +++ b/advanced-custom-fields.php @@ -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. @@ -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; });