Easy as pie!
Here’s an example to include all PHP files in a subdirectory named class.
N.B. Make sure you are one level below the class folder.
foreach (glob(plugin_dir_path(__FILE__) . "class/*.php") as $filename) include $filename;
Easy as pie!
Here’s an example to include all PHP files in a subdirectory named class.
N.B. Make sure you are one level below the class folder.
foreach (glob(plugin_dir_path(__FILE__) . "class/*.php") as $filename) include $filename;