-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
executable file
·76 lines (64 loc) · 2.03 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* Theme functions file. Defines constants, initializes the Theme class
* and includes theme lib files
*
* @package WP Unframework
* @subpackage functions.php
* @version 1.0
*/
/**
* Define constants
*
* @since 0.1.0
*/
define( 'THEME_DIR', get_template_directory() );
define( 'THEME_LIB', THEME_DIR . '/_/inc' );
define( 'THEME_ADMIN', THEME_DIR . '/_/admin' );
define( 'THEME_URI', get_stylesheet_directory_uri() );
define( 'THEME_JS_URI', THEME_URI . '/_/js/' );
define( 'THEME_CSS_URI', THEME_URI . '/_/css/' );
define( 'THEME_IMG_URI', THEME_URI . '/_/images/' );
if ( ! class_exists( 'Wpu' ) ) :
/**
* Theme setup init
* Initializes the theme class Wpu
* @since 0.1.0
*/
require_once( THEME_DIR . '/_/class-wpu.php' );
wpu_global_includes();
if ( is_admin() )
wpu_admin_includes();
else
wpu_public_includes();
new Wpu();
endif;
/**
* Uncomment custom_posts.php to create custom post types
* post types are defined in @class wpu. @see class-wpu.php & @class Wpu_Custom_Post_Types
*
* Uncomment taxonomies.php to create custom taxonomies
* taxonomies are defined in @class wpu. @see class-wpu.php & @class Wpu_Taxonomies
*/
function wpu_global_includes() {
// require_once( THEME_LIB . '/custom_posts.php' );
require_once( THEME_LIB . '/sidebars.php' );
require_once( THEME_LIB . '/widgets.php' );
// require_once( THEME_LIB . '/taxonomies.php' );
}
/**
* Uncomment custom-meta-boxes.php to include the custom metabox library
* see: @link https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
* for complete documentation.
*
* dashboard-cleanup.php enables the removal of any or all dashboard menus and meta boxes
* The action hooks are commented out and disabled by default. @see admin/dashboard-cleanup.php
*/
function wpu_admin_includes() {
// require_once( THEME_ADMIN . '/custom-meta-boxes.php' );
require_once( THEME_ADMIN . '/dashboard-cleanup.php' );
}
function wpu_public_includes() {
require_once( THEME_LIB . '/scripts.php' );
require_once( THEME_LIB . '/functions.php' );
}