| 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
 | <?php/*
 Title        : SMOF
 Description    : Slightly Modified Options Framework
 Version        : 1.5.2
 Author        : Syamil MJ
 Author URI    : http://aquagraphite.com
 License        : GPLv3 - http://www.gnu.org/copyleft/gpl.html
 
 Credits        : Thematic Options Panel - http://wptheming.com/2010/11/thematic-options-panel-v2/
 Woo Themes - http://woothemes.com/
 Option Tree - http://wordpress.org/extend/plugins/option-tree/
 
 Contributors: Syamil MJ - http://aquagraphite.com
 Andrei Surdu - http://smartik.ws/
 Jonah Dahlquist - http://nucleussystems.com/
 partnuz - https://github.com/partnuz
 Alex Poslavsky - https://github.com/plovs
 Dovy Paukstys - http://simplerain.com
 */
 
 define( 'SMOF_VERSION', '1.5.2' );
 
 /**
 * Definitions
 *
 * @since 1.4.0
 */
 $theme_version = '';
 $smof_output = '';
 
 if( function_exists( 'wp_get_theme' ) ) {
 if( is_child_theme() ) {
 $temp_obj = wp_get_theme();
 $theme_obj = wp_get_theme( $temp_obj->get('Template') );
 } else {
 $theme_obj = wp_get_theme();
 }
 
 $theme_version = $theme_obj->get('Version');
 $theme_name = $theme_obj->get('Name');
 $theme_uri = $theme_obj->get('ThemeURI');
 $author_uri = $theme_obj->get('AuthorURI');
 } else {
 $theme_data = get_theme_data( get_template_directory().'/style.css' );
 $theme_version = $theme_data['Version'];
 $theme_name = $theme_data['Name'];
 $theme_uri = $theme_data['ThemeURI'];
 $author_uri = $theme_data['AuthorURI'];
 }
 
 
 
 if( !defined('ADMIN_PATH') )
 define( 'ADMIN_PATH', get_template_directory() . '/admin/' );
 if( !defined('ADMIN_DIR') )
 define( 'ADMIN_DIR', get_template_directory_uri() . '/admin/' );
 
 define( 'ADMIN_IMAGES', ADMIN_DIR . 'assets/images/' );
 
 define( 'LAYOUT_PATH', ADMIN_PATH . 'layouts/' );
 define( 'THEMENAME', $theme_name );
 /* Theme version, uri, and the author uri are not completely necessary, but may be helpful in adding functionality */
 define( 'THEMEVERSION', $theme_version );
 define( 'THEMEURI', $theme_uri );
 define( 'THEMEAUTHORURI', $author_uri );
 
 define( 'BACKUPS','backups' );
 
 /**
 * Required action filters
 *
 * @uses add_action()
 *
 * @since 1.0.0
 */
 //if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) add_action('admin_head','of_option_setup');
 add_action('admin_head', 'optionsframework_admin_message');
 add_action('admin_init','optionsframework_admin_init');
 add_action('admin_menu', 'optionsframework_add_admin');
 
 /**
 * Required Files
 *
 * @since 1.0.0
 */
 require_once ( ADMIN_PATH . 'functions/functions.load.php' );
 require_once ( ADMIN_PATH . 'classes/class.options_machine.php' );
 
 /**
 * AJAX Saving Options
 *
 * @since 1.0.0
 */
 add_action('wp_ajax_of_ajax_post_action', 'of_ajax_callback');
 
 |