PluginProbe ʕ •ᴥ•ʔ
Loco Translate / 1.1.3
Loco Translate v1.1.3
2.8.5 2.8.4 2.5.8 2.6.0 2.6.1 2.6.10 2.6.11 2.6.12 2.6.13 2.6.14 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0 2.8.1 2.8.2 2.8.3 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2 1.2.1 1.2.2 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.17 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7
loco-translate / loco.php
loco-translate Last commit date
languages 12 years ago lib 12 years ago php 12 years ago pub 12 years ago tpl 12 years ago loco.php 12 years ago readme.txt 12 years ago
loco.php
57 lines
1 <?php
2 /*
3 Plugin Name: Loco Translate
4 Plugin URI: http://wordpress.org/extend/plugins/loco-translate
5 Description: Translate Wordpress plugins and themes directly in your browser
6 Author: Tim Whitlock
7 Version: 1.1.3
8 Author URI: http://localise.biz/help/wordpress/translate-plugin
9 */
10
11
12
13 /**
14 * Get plugin local base directory in case __DIR__ isn't available (php<5.3)
15 */
16 function loco_basedir(){
17 static $dir;
18 isset($dir) or $dir = dirname(__FILE__);
19 return $dir;
20 }
21
22
23
24 /**
25 * Include a component from lib subdirectory
26 * @param string $subpath e.g. "loco-admin"
27 * @return mixed value from last included file
28 */
29 function loco_require(){
30 $dir = loco_basedir();
31 $ret = '';
32 foreach( func_get_args() as $subpath ){
33 $ret = require_once $dir.'/lib/'.$subpath.'.php';
34 }
35 return $ret;
36 }
37
38
39
40 // Inialize admin screen
41 if( is_admin() ){
42 loco_require('loco-boot','loco-admin');
43 }
44
45 // else fire up theme functionality for admins
46 else {
47 add_action( 'after_setup_theme', 'loco_after_setup_theme' );
48 function loco_after_setup_theme(){
49 if( is_user_logged_in() ){
50 loco_require('loco-boot');
51 if( current_user_can(Loco::CAPABILITY) ){
52 // @todo font end functionality
53 }
54 }
55 }
56 }
57