forked from nilovelez/machete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmachete.php
executable file
·54 lines (39 loc) · 1.55 KB
/
machete.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
<?php
/*
Plugin Name: Machete
Plugin URI: http://www.nilovelez.com
Description: Machete is a lean and simple suite of tools that solve common WordPress anoyances: cookie bar, tracking codes, header cleanup
Version: 1.4.6
Author: Nilo Velez
Author URI: http://www.nilovelez.com
License: WTFPL
License URI: http://www.wtfpl.net/txt/copying/
Text Domain: machete
Domain Path: /languages
*/
if ( ! defined( 'ABSPATH' ) ) exit;
register_activation_hook( __FILE__, 'machete_screen_activate' );
function machete_screen_activate() {
set_transient( '_machete_welcome_redirect', true, 30 );
}
function machete_init(){
$machete_get_upload_dir = wp_upload_dir();
define('MACHETE_BASE_PATH', plugin_dir_path( __FILE__ ));
define('MACHETE_RELATIVE_BASE_PATH', substr(MACHETE_BASE_PATH, strlen(ABSPATH)-1));
define('MACHETE_BASE_URL', plugin_dir_url( __FILE__ ));
define('MACHETE_DATA_PATH', $machete_get_upload_dir['basedir'].'/machete/');
define('MACHETE_RELATIVE_DATA_PATH', substr(MACHETE_DATA_PATH, strlen(ABSPATH)-1));
define('MACHETE_DATA_URL', $machete_get_upload_dir['baseurl'].'/machete/');
if ( ! is_admin() ) {
require_once('machete_frontend.php');
}else if (current_user_can('manage_options')){
define('MACHETE_ADMIN_INIT',true);
// font-end doesn't need l10n
function machete_load_plugin_textdomain() {
load_plugin_textdomain( 'machete', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
}
add_action( 'plugins_loaded', 'machete_load_plugin_textdomain' );
require_once('machete_admin.php');
}
}
add_action('init','machete_init');