forked from loco/wp-loco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loco.php
42 lines (35 loc) · 935 Bytes
/
loco.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
<?php
/*
Plugin Name: Loco Translate
Plugin URI: http://wordpress.org/extend/plugins/loco-translate
Description: Translate WordPress plugins and themes directly in your browser
Author: Tim Whitlock
Version: 1.5.5
Author URI: https://localise.biz/help/wordpress/translate-plugin
Text Domain: loco-translate
Domain Path: /languages/
*/
/**
* Avoid conflict with version 2.0
*/
if( function_exists('loco_include') ){
return;
}
/**
* Include a component from lib subdirectory
* @param string $subpath e.g. "loco-admin"
* @return mixed value from last included file
*/
function loco_require(){
static $dir;
isset($dir) or $dir = dirname(__FILE__);
$ret = '';
foreach( func_get_args() as $subpath ){
$ret = require_once $dir.'/lib/'.$subpath.'.php';
}
return $ret;
}
// Inialize admin screen
if( function_exists('is_admin') && is_admin() ){
loco_require('loco-boot','loco-admin');
}