I create a functions.php in my project's root folder. My project has some other folder like inc and in this folder there are 2 folder like folder-1 and folder-2. So when I create a php file like something.php, I include this to my functions.php file like include_once 'inc/folder-1/something.php'. But when I create many of php file, every time I need to include or require this files to my function file.
Is there any way to include all php file together dynamically?
Like, I create..
something-1.php in folder-1
something-2.php in folder-1
something-3.php in folder-1
nothing-1.php in folder-2
nothing-2.php in folder-2
nothing-3.php in folder-2
Now I include this file to my function file by writing like this..
include_once 'inc/folder-1/something-1.php';
include_once 'inc/folder-1/something-2.php';
include_once 'inc/folder-1/something-3.php';
include_once 'inc/folder-2/nothing-1.php';
include_once 'inc/folder-2/nothing-2.php';
include_once 'inc/folder-2/nothing-3.php';
Is there any solution to avoid this manual including system?
Like, when I create a new file in those folder, this will automatically include in functions.php file, and when I delete this, there will be no impact on my project...