| @@ -6,42 +6,21 @@ | ||
| 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.2 | |
| 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.2' ); | |
| 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'; |
| 47 | 26 | require_once BOGO_PLUGIN_DIR . '/includes/nav-menu.php'; |
| @@ -47,9 +26,11 @@ | ||
| 47 | 26 | require_once BOGO_PLUGIN_DIR . '/includes/nav-menu.php'; |
| 48 | 27 | require_once BOGO_PLUGIN_DIR . '/includes/widgets.php'; |
| 49 | 28 | require_once BOGO_PLUGIN_DIR . '/includes/post.php'; |
| 50 | 29 | require_once BOGO_PLUGIN_DIR . '/includes/user.php'; |
| 30 | +require_once BOGO_PLUGIN_DIR . '/includes/capabilities.php'; | |
| 51 | 31 | require_once BOGO_PLUGIN_DIR . '/includes/query.php'; |
| 32 | +require_once BOGO_PLUGIN_DIR . '/includes/flags.php'; | |
| 52 | 33 | |
| 53 | 34 | if ( is_admin() ) { |
| 54 | 35 | require_once BOGO_PLUGIN_DIR . '/admin/admin.php'; |
| 55 | 36 | } |
| @@ -130,5 +111,23 @@ | ||
| 130 | 111 | } |
| 131 | 112 | |
| 132 | 113 | add_shortcode( 'bogo', 'bogo_language_switcher' ); |
| 133 | 114 | |
| 134 | -?> | |
| 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 | +} | |