forked from Elive/sitepush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sitepush.php
104 lines (90 loc) · 2.91 KB
/
sitepush.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/*
Plugin Name: SitePush
Plugin URI: http://rowatt.com/sitepush
Description: Easily move code and content between versions of a site
Version: 0.4.1
Author: Mark Rowatt Anderson
Author URI: http://rowatt.com
License: GPL2
*/
/* Copyright 2009-2012 Mark Rowatt Anderson (http://rowatt.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once('classes/class-sitepush-plugin.php');
require_once('classes/class-sitepush-errors.php');
SitePushPlugin::get_instance();
//load classes which are required for admin
if( is_admin() )
{
require_once('classes/class-sitepush-core.php');
require_once('classes/class-sitepush-screen.php');
require_once('classes/class-sitepush-options-screen.php');
require_once('classes/class-sitepush-push-screen.php');
}
//get the plugin basename and abs path to plugin directory
//__FILE__ won't work for basename if path has symlinks
//if basename using __FILE__ has more than one '/' we probably
//have symlinks, in which case we have to assume that plugin is at
//sitepush/sitepush.php - so don't change dir if using symlinks!
if( substr_count(plugin_basename(__FILE__), DIRECTORY_SEPARATOR) <= 1 )
define('SITEPUSH__FILE', __FILE__);
else
define('SITEPUSH__FILE', WP_PLUGIN_DIR . '/' . 'sitepush/sitepush.php' );
define( 'SITEPUSH_PLUGIN_DIR_URL', plugins_url( '', SITEPUSH__FILE ) );
define( 'SITEPUSH_PLUGIN_DIR', dirname(SITEPUSH__FILE) );
define( 'SITEPUSH_BASENAME', plugin_basename(SITEPUSH__FILE) );
//define as TRUE in wp-config to turn on debug mode
if( !defined('SITEPUSH_DEBUG') )
define( 'SITEPUSH_DEBUG', FALSE );
/* --------------------------------------------------------------
/* ! Wrappers for deprecated WP functions
/* -------------------------------------------------------------- */
/**
* Get name of current theme
*
* @since WordPress 3.4
*
* @return string
*/
function _deprecated_get_current_theme()
{
if( function_exists('wp_get_theme') )
{
return (string) wp_get_theme();
}
else
{
return get_current_theme();
}
}
/**
* Get directory name of current theme
*
* @since WordPress 3.4
*
* @return string
*/
function _deprecated_get_theme_stylesheet()
{
if( function_exists('wp_get_theme') )
{
$theme = wp_get_theme();
return $theme->stylesheet;
}
else
{
$themes = get_themes();
return $themes[ get_current_theme() ]['Stylesheet'];
}
}
/* EOF */