1
0
mirror of https://github.com/kremalicious/Badged.git synced 2024-12-27 15:17:43 +01:00

smarter stuff for local symlinked development

This commit is contained in:
Matthias Kretschmann 2013-08-09 17:50:44 +02:00
parent 51ac00b1d0
commit 35a6106257
2 changed files with 16 additions and 8 deletions

View File

@ -51,8 +51,16 @@ else if (isset($network_plugin)) {
$badged_plugin_file = $network_plugin;
}
define('BADGED_PLUGIN_FILE', $badged_plugin_file);
//define('BADGED_PLUGIN_PATH', WP_PLUGIN_DIR.'/'.basename(dirname($badged_plugin_file)));
// Define constants
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 ));
}
/**
* Let's roll
@ -61,9 +69,9 @@ define('BADGED_PLUGIN_FILE', $badged_plugin_file);
*
*/
require_once( plugin_dir_path( BADGED_PLUGIN_FILE ) . 'class-badged.php' );
require_once( BADGED_PATH . 'class-badged.php' );
register_activation_hook( BADGED_PLUGIN_FILE, array( 'Badged', 'activate' ) );
register_deactivation_hook( BADGED_PLUGIN_FILE, array( 'Badged', 'deactivate' ) );
register_activation_hook( $badged_plugin_file, array( 'Badged', 'activate' ) );
register_deactivation_hook( $badged_plugin_file, array( 'Badged', 'deactivate' ) );
Badged::get_instance();

View File

@ -127,7 +127,7 @@ class Badged {
$locale = apply_filters( 'bdgd', get_locale(), $domain );
load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
load_plugin_textdomain( $domain, FALSE, dirname( plugin_basename( BADGED_PLUGIN_FILE ) ) . '/lang/' );
load_plugin_textdomain( $domain, FALSE, dirname( BADGED_BASENAME ) . '/lang/' );
}
/**
@ -144,10 +144,10 @@ class Badged {
$screen = get_current_screen();
if ( $screen->id == $this->plugin_screen_hook_suffix ) {
wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'css/options.css', BADGED_PLUGIN_FILE ), array(), $this->version );
wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'css/options.css', BADGED_BASENAME ), array(), $this->version );
}
wp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'css/badged.css', BADGED_PLUGIN_FILE ), array(), $this->version );
wp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'css/badged.css', BADGED_BASENAME ), array(), $this->version );
}