-
Notifications
You must be signed in to change notification settings - Fork 2
/
functions.php
33 lines (30 loc) · 1002 Bytes
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* FoundationPress functions and definitions
*
* Set up the theme and provides some helper functions, which are used in the
* theme as custom template tags. Others are attached to action and filter
* hooks in WordPress to change core functionality.
*
* @link https://codex.wordpress.org/Theme_Development
* @package FoundationPress
* @since FoundationPress 1.0.0
*/
// composer autoload.
require_once __DIR__ . '/vendor/autoload.php';
/**
* Requires all files recursively within given directory
*
* @param string $path path to directory which should be required recursively.
*/
function foundationpress_recursive_require_dir( $path ) {
$dir = new RecursiveDirectoryIterator( $path );
$iterator = new RecursiveIteratorIterator( $dir );
foreach ( $iterator as $file ) {
$fname = $file->getFilename();
if ( preg_match( '%\.php$%', $fname ) ) {
require_once $file->getPathname();
}
}
}
foundationpress_recursive_require_dir( get_template_directory() . '/inc' );