Skip to content

Instantly share code, notes, and snippets.

@will83
Last active August 29, 2015 14:00
Show Gist options
  • Save will83/11177590 to your computer and use it in GitHub Desktop.
Save will83/11177590 to your computer and use it in GitHub Desktop.
Wordpress function.php include function
<?php
if ( ! function_exists( 'get_function_files' ) ) {
function get_function_files($path){
$function_files = glob($folder.$path, GLOB_BRACE);
foreach($function_files as $function_file){
if (substr($function_file, -8) != '-off.php'){
require_once($function_file);
}
}
}
}
get_function_files(dirname(__FILE__).'/functions/*.{php}');
get_function_files(dirname(__FILE__).'/functions/*/*.{php}');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment