Including more files from /app/ directory

Is there any reason why the array map in functions.php is setup to include specific files, and not just /app/*.php? I’m writing ACF fields and Post Types and would prefer they just get included by being there instead of needing to be specified individually.

Or is there a better/more Sage-like way?

Don’t know the philosophy of the Sage team, but I prefer to manually include files for the following reasons:

  • Makes it clear what is being loaded and when to someone unfamiliar with the project
  • Makes it much easier to debug (simple to comment out files)
  • Loading and executing files with a wildcard makes me extremely nervous
  • The extra effort required to add a file to that array is minimal and reminds me of what I’m doing
1 Like