2011-12-17 22:11:20 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2013-08-07 21:55:35 +02:00
|
|
|
* Badged
|
|
|
|
*
|
|
|
|
* Transforms the standard WordPress update & comment notification badges into iOS-styled ones.
|
|
|
|
* Just activate and enjoy the red badges.
|
|
|
|
*
|
|
|
|
* @package Badged
|
2013-11-09 14:38:40 +01:00
|
|
|
* @author Matthias Kretschmann <m@kretschmann.io>
|
2013-08-07 21:55:35 +02:00
|
|
|
* @license GPL-2.0+
|
|
|
|
* @link http://kremalicious.com/badged/
|
|
|
|
* @copyright 2013 Matthias Kretschmann
|
|
|
|
*
|
|
|
|
* @wordpress-plugin
|
2011-12-17 22:11:20 +01:00
|
|
|
* Plugin Name: Badged
|
2012-05-31 23:24:14 +02:00
|
|
|
* Plugin URI: http://kremalicious.com/badged/
|
2011-12-18 15:58:24 +01:00
|
|
|
* Description: Transforms the standard WordPress update & comment notification badges into iOS-styled ones. Just activate and enjoy the red badges.
|
2011-12-17 22:11:20 +01:00
|
|
|
* Author: Matthias Kretschmann
|
|
|
|
* Author URI: http://matthiaskretschmann.com
|
2013-11-09 14:38:40 +01:00
|
|
|
* Version: 2.0.0
|
2013-08-07 21:55:35 +02:00
|
|
|
* License: GPL-2.0+
|
|
|
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
2013-11-09 14:38:40 +01:00
|
|
|
* Domain Path: /languages
|
2013-08-07 21:55:35 +02:00
|
|
|
* Text Domain: bdgd
|
2011-12-17 22:11:20 +01:00
|
|
|
*/
|
|
|
|
|
2013-08-07 21:55:35 +02:00
|
|
|
// If this file is called directly, abort.
|
|
|
|
if ( ! defined( 'WPINC' ) ) {
|
|
|
|
die;
|
|
|
|
}
|
2011-12-17 22:13:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Make the plugin work if symlinked
|
|
|
|
*
|
|
|
|
* Thanks to:
|
|
|
|
* http://alexking.org/blog/2011/12/15/wordpress-plugins-and-symlinks
|
|
|
|
*
|
|
|
|
* @since 0.3.2
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
$badged_plugin_file = __FILE__;
|
|
|
|
|
|
|
|
if (isset($plugin)) {
|
|
|
|
$badged_plugin_file = $plugin;
|
|
|
|
}
|
|
|
|
else if (isset($mu_plugin)) {
|
|
|
|
$badged_plugin_file = $mu_plugin;
|
|
|
|
}
|
|
|
|
else if (isset($network_plugin)) {
|
|
|
|
$badged_plugin_file = $network_plugin;
|
|
|
|
}
|
|
|
|
|
2013-08-09 17:50:44 +02:00
|
|
|
// Define constants
|
2013-11-09 14:38:40 +01:00
|
|
|
if ( ! defined( 'BADGED_FILE' ) ){
|
|
|
|
define('BADGED_FILE', $badged_plugin_file);
|
|
|
|
}
|
2013-08-09 17:50:44 +02:00
|
|
|
if ( ! defined( 'BADGED_URL' ) ){
|
|
|
|
define('BADGED_URL', plugin_dir_url($badged_plugin_file));
|
|
|
|
}
|
|
|
|
if ( ! defined( 'BADGED_PATH' ) ){
|
|
|
|
define('BADGED_PATH', WP_PLUGIN_DIR.'/'.basename(dirname($badged_plugin_file)).'/');
|
|
|
|
}
|
|
|
|
if ( ! defined( 'BADGED_BASENAME' ) ){
|
|
|
|
define('BADGED_BASENAME', plugin_basename( $badged_plugin_file ));
|
|
|
|
}
|
2011-12-17 22:13:07 +01:00
|
|
|
|
2013-08-06 21:29:15 +02:00
|
|
|
/**
|
2013-08-07 21:55:35 +02:00
|
|
|
* Let's roll
|
2013-08-06 21:29:15 +02:00
|
|
|
*
|
2013-11-09 14:38:40 +01:00
|
|
|
* @since 2.0.0
|
2013-08-06 21:29:15 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-11-09 14:38:40 +01:00
|
|
|
//
|
|
|
|
// Public Stuff
|
|
|
|
//
|
|
|
|
require_once( BADGED_PATH . '/public/class-badged.php' );
|
2013-08-06 21:29:15 +02:00
|
|
|
|
2013-08-09 17:50:44 +02:00
|
|
|
register_activation_hook( $badged_plugin_file, array( 'Badged', 'activate' ) );
|
|
|
|
register_deactivation_hook( $badged_plugin_file, array( 'Badged', 'deactivate' ) );
|
2011-12-17 22:11:20 +01:00
|
|
|
|
2013-11-09 14:38:40 +01:00
|
|
|
add_action( 'plugins_loaded', array( 'Badged', 'get_instance' ) );
|
|
|
|
|
|
|
|
//
|
|
|
|
// Admin Stuff
|
|
|
|
//
|
2013-11-09 15:07:36 +01:00
|
|
|
if ( is_admin() ) {
|
2013-11-09 14:38:40 +01:00
|
|
|
|
|
|
|
require_once( BADGED_PATH . '/admin/class-badged-admin.php' );
|
|
|
|
add_action( 'plugins_loaded', array( 'Badged_Admin', 'get_instance' ) );
|
|
|
|
|
|
|
|
}
|