| @@ -6,52 +6,36 @@ | ||
| 6 | 6 | Author: Takayuki Miyoshi |
| 7 | 7 | Author URI: http://ideasilo.wordpress.com/ |
| 8 | 8 | Text Domain: bogo |
| 9 | 9 | Domain Path: /languages/ |
| 10 | -Version: 2.1.3 | |
| 10 | +Version: 2.6 | |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -/* Copyright 2007-2014 Takayuki Miyoshi (email: takayukister at gmail.com) | |
| 13 | +define( 'BOGO_VERSION', '2.6' ); | |
| 14 | 14 | |
| 15 | - This program is free software; you can redistribute it and/or modify | |
| 16 | - it under the terms of the GNU General Public License as published by | |
| 17 | - the Free Software Foundation; either version 2 of the License, or | |
| 18 | - (at your option) any later version. | |
| 15 | +define( 'BOGO_PLUGIN', __FILE__ ); | |
| 19 | 16 | |
| 20 | - This program is distributed in the hope that it will be useful, | |
| 21 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 22 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 23 | - GNU General Public License for more details. | |
| 17 | +define( 'BOGO_PLUGIN_BASENAME', plugin_basename( BOGO_PLUGIN ) ); | |
| 24 | 18 | |
| 25 | - You should have received a copy of the GNU General Public License | |
| 26 | - along with this program; if not, write to the Free Software | |
| 27 | - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 28 | -*/ | |
| 19 | +define( 'BOGO_PLUGIN_NAME', trim( dirname( BOGO_PLUGIN_BASENAME ), '/' ) ); | |
| 29 | 20 | |
| 30 | -define( 'BOGO_VERSION', '2.1.3' ); | |
| 21 | +define( 'BOGO_PLUGIN_DIR', untrailingslashit( dirname( BOGO_PLUGIN ) ) ); | |
| 31 | 22 | |
| 32 | -if ( ! defined( 'BOGO_PLUGIN_BASENAME' ) ) | |
| 33 | - define( 'BOGO_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); | |
| 34 | - | |
| 35 | -if ( ! defined( 'BOGO_PLUGIN_NAME' ) ) | |
| 36 | - define( 'BOGO_PLUGIN_NAME', trim( dirname( BOGO_PLUGIN_BASENAME ), '/' ) ); | |
| 37 | - | |
| 38 | -if ( ! defined( 'BOGO_PLUGIN_DIR' ) ) | |
| 39 | - define( 'BOGO_PLUGIN_DIR', untrailingslashit( dirname( __FILE__ ) ) ); | |
| 40 | - | |
| 41 | -if ( ! defined( 'BOGO_PLUGIN_URL' ) ) | |
| 42 | - define( 'BOGO_PLUGIN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) ); | |
| 43 | - | |
| 44 | 23 | require_once BOGO_PLUGIN_DIR . '/includes/functions.php'; |
| 45 | 24 | require_once BOGO_PLUGIN_DIR . '/includes/rewrite.php'; |
| 46 | 25 | require_once BOGO_PLUGIN_DIR . '/includes/link-template.php'; |
| 26 | +require_once BOGO_PLUGIN_DIR . '/includes/nav-menu.php'; | |
| 47 | 27 | require_once BOGO_PLUGIN_DIR . '/includes/widgets.php'; |
| 48 | -require_once BOGO_PLUGIN_DIR . '/includes/post-l10n-functions.php'; | |
| 49 | -require_once BOGO_PLUGIN_DIR . '/includes/user-l10n-functions.php'; | |
| 50 | -require_once BOGO_PLUGIN_DIR . '/includes/post-l10n.php'; | |
| 51 | -require_once BOGO_PLUGIN_DIR . '/includes/user-l10n.php'; | |
| 28 | +require_once BOGO_PLUGIN_DIR . '/includes/post.php'; | |
| 29 | +require_once BOGO_PLUGIN_DIR . '/includes/user.php'; | |
| 30 | +require_once BOGO_PLUGIN_DIR . '/includes/capabilities.php'; | |
| 52 | 31 | require_once BOGO_PLUGIN_DIR . '/includes/query.php'; |
| 32 | +require_once BOGO_PLUGIN_DIR . '/includes/flags.php'; | |
| 53 | 33 | |
| 34 | +if ( is_admin() ) { | |
| 35 | + require_once BOGO_PLUGIN_DIR . '/admin/admin.php'; | |
| 36 | +} | |
| 37 | + | |
| 54 | 38 | add_action( 'plugins_loaded', 'bogo_plugins_loaded' ); |
| 55 | 39 | |
| 56 | 40 | function bogo_plugins_loaded() { |
| 57 | 41 | load_plugin_textdomain( 'bogo', 'wp-content/plugins/bogo/languages', 'bogo/languages' ); |
| @@ -125,5 +109,25 @@ | ||
| 125 | 109 | |
| 126 | 110 | return $query_vars; |
| 127 | 111 | } |
| 128 | 112 | |
| 129 | -?> | |
| 113 | +add_shortcode( 'bogo', 'bogo_language_switcher' ); | |
| 114 | + | |
| 115 | +add_action( 'wp_enqueue_scripts', 'bogo_enqueue_scripts' ); | |
| 116 | + | |
| 117 | +function bogo_enqueue_scripts() { | |
| 118 | + wp_enqueue_style( 'bogo', | |
| 119 | + plugins_url( 'includes/css/style.css', BOGO_PLUGIN_BASENAME ), | |
| 120 | + array(), BOGO_VERSION, 'all' ); | |
| 121 | + | |
| 122 | + if ( is_rtl() ) { | |
| 123 | + wp_enqueue_style( 'bogo-rtl', | |
| 124 | + plugins_url( 'includes/css/style-rtl.css', BOGO_PLUGIN_BASENAME ), | |
| 125 | + array(), BOGO_VERSION, 'all' ); | |
| 126 | + } | |
| 127 | +} | |
| 128 | + | |
| 129 | +add_action( 'deactivate_' . BOGO_PLUGIN_BASENAME, 'bogo_deactivate' ); | |
| 130 | + | |
| 131 | +function bogo_deactivate() { | |
| 132 | + bogo_delete_prop( 'lang_rewrite_regex' ); | |
| 133 | +} | |