-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
36 lines (32 loc) · 1.3 KB
/
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
34
35
36
<?php
/**
* Theme functions file that is autoloaded by WordPress. Used to define
* constants and load required files. All other functionality should be
* contained in the includes directory, which is autoloaded.
*
* @author Cory Hughart <[email protected]>
* @copyright 2024 Cory Hughart
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL-3.0-or-later
* @link https://github.com/cr0ybot/wp-block-theme-scaffold
* @package WPBTS
*/
// Prevent direct access.
defined( 'ABSPATH' ) || exit;
define( 'WPBTS_THEME_PATH', trailingslashit( get_template_directory() ) );
define( 'WPBTS_THEME_URI', trailingslashit( get_template_directory_uri() ) );
define( 'WPBTS_DIST_PATH', WPBTS_THEME_PATH . 'build/' );
define( 'WPBTS_DIST_URI', WPBTS_THEME_URI . 'build/' );
define( 'WPBTS_BLOCKS_PATH', WPBTS_DIST_PATH . 'blocks/' );
// Load Composer autoloader if not already loaded.
if ( is_file( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
/**
* Automatically require all PHP files in the includes directory.
* Note that these files should be namespaced and should not use functions
* from other files except within hook callbacks, since they are loaded
* in an arbitrary order.
*/
foreach ( glob( __DIR__ . '/includes/*.php' ) as $file ) {
require_once $file;
}