Created
June 11, 2012 21:48
-
-
Save raideus/2912958 to your computer and use it in GitHub Desktop.
PHP Auto Include
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* -------------------------------------------------------------------- | |
:: Auto-Includer | |
Loads PHP files from the /includes/ directory. For WordPress sites, | |
this code would go in your functions.php file. | |
-------------------------------------------------------------------- */ | |
foreach (glob(__DIR__ . '/includes/*.php') as $my_theme_filename) { | |
// Exclude files whose names contain -sample | |
if (!strpos($my_theme_filename, '-sample') ) { | |
include_once $my_theme_filename; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment