PluginProbe
Unagi / 0.2
Unagi v0.2
0.3.1 trunk 0.1.0 0.1.1 0.1.2 0.1.3 0.1.4 0.1.5 0.2 0.2.1 0.2.2 0.3
unagi / includes / core.php

core.php in Unagi 0.2, at includes/core.php

48 lines 844 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Core plugin functionality.
4 *
5 * @package Unagi
6 */
7
8 namespace Unagi\Core;
9
10 use \WP_Error as WP_Error;
11
12 /**
13 * Default setup routine
14 *
15 * @return void
16 */
17 function setup() {
18 $n = function ( $function ) {
19 return __NAMESPACE__ . "\\$function";
20 };
21
22 add_action( 'init', $n( 'i18n' ) );
23 add_action( 'init', $n( 'init' ) );
24
25 do_action( 'unagi_loaded' );
26 }
27
28 /**
29 * Registers the default textdomain.
30 *
31 * @return void
32 */
33 function i18n() {
34 $locale = apply_filters( 'plugin_locale', get_locale(), 'unagi' );
35 load_textdomain( 'unagi', WP_LANG_DIR . '/unagi/unagi-' . $locale . '.mo' );
36 load_plugin_textdomain( 'unagi', false, plugin_basename( UNAGI_PATH ) . '/languages/' );
37 }
38
39 /**
40 * Initializes the plugin and fires an action other plugins can hook into.
41 *
42 * @return void
43 */
44 function init() {
45 do_action( 'unagi_init' );
46 }
47
48