raw
mp-wp_genesis           1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * WordPress Administration Bootstrap
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 * @subpackage Administration
mp-wp_genesis 7 */
mp-wp_genesis 8
mp-wp_genesis 9 /**
mp-wp_genesis 10 * In WordPress Administration Panels
mp-wp_genesis 11 *
mp-wp_genesis 12 * @since unknown
mp-wp_genesis 13 */
mp-wp_genesis 14 define('WP_ADMIN', TRUE);
mp-wp_genesis 15
mp-wp_genesis 16 if ( defined('ABSPATH') )
mp-wp_genesis 17 require_once(ABSPATH . 'wp-load.php');
mp-wp_genesis 18 else
mp-wp_genesis 19 require_once('../wp-load.php');
mp-wp_genesis 20
mp-wp_genesis 21 if ( get_option('db_version') != $wp_db_version ) {
mp-wp_genesis 22 wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
mp-wp_genesis 23 exit;
mp-wp_genesis 24 }
mp-wp_genesis 25
mp-wp_genesis 26 require_once(ABSPATH . 'wp-admin/includes/admin.php');
mp-wp_genesis 27
mp-wp_genesis 28 auth_redirect();
mp-wp_genesis 29
mp-wp_genesis 30 nocache_headers();
mp-wp_genesis 31
mp-wp_genesis 32 update_category_cache();
mp-wp_genesis 33
mp-wp_genesis 34 $posts_per_page = get_option('posts_per_page');
mp-wp_genesis 35 $what_to_show = get_option('what_to_show');
mp-wp_genesis 36 $date_format = get_option('date_format');
mp-wp_genesis 37 $time_format = get_option('time_format');
mp-wp_genesis 38
mp-wp_genesis 39 wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
mp-wp_genesis 40
mp-wp_genesis 41 wp_admin_css_color('classic', __('Blue'), admin_url("css/colors-classic.css"), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7'));
mp-wp_genesis 42 wp_admin_css_color('fresh', __('Gray'), admin_url("css/colors-fresh.css"), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF'));
mp-wp_genesis 43
mp-wp_genesis 44 wp_enqueue_script( 'common' );
mp-wp_genesis 45 wp_enqueue_script( 'jquery-color' );
mp-wp_genesis 46
mp-wp_genesis 47 $editing = false;
mp-wp_genesis 48
mp-wp_genesis 49 if (isset($_GET['page'])) {
mp-wp_genesis 50 $plugin_page = stripslashes($_GET['page']);
mp-wp_genesis 51 $plugin_page = plugin_basename($plugin_page);
mp-wp_genesis 52 }
mp-wp_genesis 53
mp-wp_genesis 54 require(ABSPATH . 'wp-admin/menu.php');
mp-wp_genesis 55
mp-wp_genesis 56 do_action('admin_init');
mp-wp_genesis 57
mp-wp_genesis 58 // Handle plugin admin pages.
mp-wp_genesis 59 if (isset($plugin_page)) {
mp-wp_genesis 60 if( ! $page_hook = get_plugin_page_hook($plugin_page, $pagenow) ) {
mp-wp_genesis 61 $page_hook = get_plugin_page_hook($plugin_page, $plugin_page);
mp-wp_genesis 62 // backwards compatibility for plugins using add_management_page
mp-wp_genesis 63 if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) {
mp-wp_genesis 64 wp_redirect('tools.php?page=' . $plugin_page);
mp-wp_genesis 65 exit;
mp-wp_genesis 66 }
mp-wp_genesis 67 }
mp-wp_genesis 68
mp-wp_genesis 69 if ( $page_hook ) {
mp-wp_genesis 70 do_action('load-' . $page_hook);
mp-wp_genesis 71 if (! isset($_GET['noheader']))
mp-wp_genesis 72 require_once(ABSPATH . 'wp-admin/admin-header.php');
mp-wp_genesis 73
mp-wp_genesis 74 do_action($page_hook);
mp-wp_genesis 75 } else {
mp-wp_genesis 76 if ( validate_file($plugin_page) ) {
mp-wp_genesis 77 wp_die(__('Invalid plugin page'));
mp-wp_genesis 78 }
mp-wp_genesis 79
mp-wp_genesis 80 if (! ( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) )
mp-wp_genesis 81 wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
mp-wp_genesis 82
mp-wp_genesis 83 do_action('load-' . $plugin_page);
mp-wp_genesis 84
mp-wp_genesis 85 if (! isset($_GET['noheader']))
mp-wp_genesis 86 require_once(ABSPATH . 'wp-admin/admin-header.php');
mp-wp_genesis 87
mp-wp_genesis 88 include(WP_PLUGIN_DIR . "/$plugin_page");
mp-wp_genesis 89 }
mp-wp_genesis 90
mp-wp_genesis 91 include(ABSPATH . 'wp-admin/admin-footer.php');
mp-wp_genesis 92
mp-wp_genesis 93 exit();
mp-wp_genesis 94 } else if (isset($_GET['import'])) {
mp-wp_genesis 95
mp-wp_genesis 96 $importer = $_GET['import'];
mp-wp_genesis 97
mp-wp_genesis 98 if ( ! current_user_can('import') )
mp-wp_genesis 99 wp_die(__('You are not allowed to import.'));
mp-wp_genesis 100
mp-wp_genesis 101 if ( validate_file($importer) ) {
mp-wp_genesis 102 wp_die(__('Invalid importer.'));
mp-wp_genesis 103 }
mp-wp_genesis 104
mp-wp_genesis 105 // Allow plugins to define importers as well
mp-wp_genesis 106 if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2]))
mp-wp_genesis 107 {
mp-wp_genesis 108 if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
mp-wp_genesis 109 {
mp-wp_genesis 110 wp_die(__('Cannot load importer.'));
mp-wp_genesis 111 }
mp-wp_genesis 112 include(ABSPATH . "wp-admin/import/$importer.php");
mp-wp_genesis 113 }
mp-wp_genesis 114
mp-wp_genesis 115 $parent_file = 'tools.php';
mp-wp_genesis 116 $submenu_file = 'import.php';
mp-wp_genesis 117 $title = __('Import');
mp-wp_genesis 118
mp-wp_genesis 119 if (! isset($_GET['noheader']))
mp-wp_genesis 120 require_once(ABSPATH . 'wp-admin/admin-header.php');
mp-wp_genesis 121
mp-wp_genesis 122 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
mp-wp_genesis 123
mp-wp_genesis 124 define('WP_IMPORTING', true);
mp-wp_genesis 125
mp-wp_genesis 126 call_user_func($wp_importers[$importer][2]);
mp-wp_genesis 127
mp-wp_genesis 128 include(ABSPATH . 'wp-admin/admin-footer.php');
mp-wp_genesis 129
mp-wp_genesis 130 // Make sure rules are flushed
mp-wp_genesis 131 global $wp_rewrite;
mp-wp_genesis 132 $wp_rewrite->flush_rules();
mp-wp_genesis 133
mp-wp_genesis 134 exit();
mp-wp_genesis 135 } else {
mp-wp_genesis 136 do_action("load-$pagenow");
mp-wp_genesis 137 }
mp-wp_genesis 138
mp-wp_genesis 139 if ( !empty($_REQUEST['action']) )
mp-wp_genesis 140 do_action('admin_action_' . $_REQUEST['action']);
mp-wp_genesis 141
mp-wp_genesis 142 ?>