-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmega_framework.php
More file actions
46 lines (37 loc) · 1.31 KB
/
mega_framework.php
File metadata and controls
46 lines (37 loc) · 1.31 KB
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
<?php
/*
Plugin Name: MegaFramework
Plugin URI: http://hadyfayed.com/plugins/megacore
Description: This is a framework for wordpress to serve both theme and plugins to make it a bit easier to do your job
Version: 1.0
Author: Hady Fayed
Author URI: http://hadyfayed.com
License: GPL2
*/
use MageArab\MegaFramework\Core\Autoloader;
use MageArab\MegaFramework\MegaFramework;
if (!defined('ABSPATH') || !defined('WPINC')) {
die;
}
require_once __DIR__ . '/src/Trait/Singleton.php';
require_once __DIR__ . '/src/Trait/SmartObject.php';
require_once __DIR__ . '/src/Trait/StaticClass.php';
require_once __DIR__ . '/src/Utils/FileSystem.php';
require_once __DIR__ . '/src/Utils/Finder.php';
require_once __DIR__ . '/src/Exceptions/MemberAccessException.php';
require_once __DIR__.'/src/Core/Autoloader.php';
require_once __DIR__ . '/src/MegaFramework.php';
function load_core_first()
{
$path = plugin_basename(dirname(__FILE__)).'/'.basename(__FILE__);
if ( $plugins = get_option( 'active_plugins' ) ) {
if ( $key = array_search( $path, $plugins ) ) {
array_splice( $plugins, $key, 1 );
array_unshift( $plugins, $path );
update_option( 'active_plugins', $plugins );
}
}
}
add_action( 'activated_plugin','load_core_first' );
Autoloader::instance();
MegaFramework::instance();