mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-05 09:19:53 +08:00
code cleanup
This commit is contained in:
parent
fdf00b15f2
commit
911adc5bb9
61 changed files with 23275 additions and 22852 deletions
|
@ -7,31 +7,33 @@
|
|||
Author URI: http://mainwp.com
|
||||
Version: 2.0.29
|
||||
*/
|
||||
if ((isset($_REQUEST['heatmap']) && $_REQUEST['heatmap'] == '1') || (isset($_REQUEST['mainwpsignature']) && (!empty($_REQUEST['mainwpsignature'])))) {
|
||||
header('X-Frame-Options: ALLOWALL');
|
||||
if ( ( isset( $_REQUEST['heatmap'] ) && '1' === $_REQUEST['heatmap'] ) || ( isset( $_REQUEST['mainwpsignature'] ) && ( ! empty( $_REQUEST['mainwpsignature'] ) ) ) ) {
|
||||
header( 'X-Frame-Options: ALLOWALL' );
|
||||
}
|
||||
//header('X-Frame-Options: GOFORIT');
|
||||
include_once(ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php'); //Version information from wordpress
|
||||
include_once( ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php' ); //Version information from wordpress
|
||||
|
||||
$classDir = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . str_replace(basename(__FILE__), '', plugin_basename(__FILE__)) . 'class' . DIRECTORY_SEPARATOR;
|
||||
function mainwp_child_autoload($class_name) {
|
||||
$class_file = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . str_replace(basename(__FILE__), '', plugin_basename(__FILE__)) . 'class' . DIRECTORY_SEPARATOR . $class_name . '.class.php';
|
||||
if (file_exists($class_file)) {
|
||||
require_once($class_file);
|
||||
}
|
||||
}
|
||||
if (function_exists('spl_autoload_register'))
|
||||
{
|
||||
spl_autoload_register('mainwp_child_autoload');
|
||||
}
|
||||
else
|
||||
{
|
||||
function __autoload($class_name) {
|
||||
mainwp_child_autoload($class_name);
|
||||
}
|
||||
$main_wp_class_dir = trailingslashit( plugin_dir_path( dirname( __FILE__ ) ) ) . 'class';
|
||||
|
||||
function mainwp_child_autoload( $class_name ) {
|
||||
global $main_wp_class_dir;
|
||||
|
||||
$autoload_dir = \trailingslashit( $main_wp_class_dir );
|
||||
$autoload_path = sprintf( '%sclass-%s.php', $autoload_dir, strtolower( str_replace( '_', '-', $class_name ) ) );
|
||||
|
||||
if ( file_exists( $autoload_path ) ) {
|
||||
require_once( $autoload_path );
|
||||
}
|
||||
}
|
||||
|
||||
$mainWPChild = new MainWPChild(WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename(__FILE__));
|
||||
register_activation_hook(__FILE__, array($mainWPChild, 'activation'));
|
||||
register_deactivation_hook(__FILE__, array($mainWPChild, 'deactivation'));
|
||||
?>
|
||||
if ( function_exists( 'spl_autoload_register' ) ) {
|
||||
spl_autoload_register( 'mainwp_child_autoload' );
|
||||
} else {
|
||||
function __autoload( $class_name ) {
|
||||
mainwp_child_autoload( $class_name );
|
||||
}
|
||||
}
|
||||
|
||||
$mainWPChild = new MainWP_Child( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename( __FILE__ ) );
|
||||
register_activation_hook( __FILE__, array( $mainWPChild, 'activation' ) );
|
||||
register_deactivation_hook( __FILE__, array( $mainWPChild, 'deactivation' ) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue