From c43b64d39ec0f5486223a776d40c77a87a16838d Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 14 Dec 2011 19:38:20 +0100 Subject: [PATCH] now works on toolbar in frontend too slightly different options page layout --- bubbles-menu.css | 2 +- bubbles-settings.php | 22 +++++++++------------- bubbles.php | 11 +++++++++-- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/bubbles-menu.css b/bubbles-menu.css index c887951..c2c967b 100644 --- a/bubbles-menu.css +++ b/bubbles-menu.css @@ -100,7 +100,7 @@ #bubblesoptions form h2 { border-bottom: 1px solid #eee; border-top: 1px solid #eee; - margin-top: 1em; + margin-top: .5em; padding: 10px 0; } diff --git a/bubbles-settings.php b/bubbles-settings.php index 5545b96..80c9895 100644 --- a/bubbles-settings.php +++ b/bubbles-settings.php @@ -13,27 +13,23 @@

- - + - /> +
+ /> + +
+ /> + +
- - - - - - - - /> - - + diff --git a/bubbles.php b/bubbles.php index 1e94fd9..3ff7fc5 100644 --- a/bubbles.php +++ b/bubbles.php @@ -15,7 +15,6 @@ if (function_exists('load_plugin_textdomain')) { } function bubbles_init() { - bubbles_register_settings(); if ( get_option('menu') == 'yes') { wp_register_style('bubbles-menu-css', plugins_url('/bubbles/bubbles-menu.css'), false, '9001'); @@ -26,7 +25,13 @@ function bubbles_init() { wp_register_style('bubbles-bar-css', plugins_url('/bubbles/bubbles-bar.css'), false, '9001'); wp_enqueue_style('bubbles-bar-css'); } - +} + +function bubbles_bar_only_init() { + if ( get_option('bar') == 'yes') { + wp_register_style('bubbles-bar-css', plugins_url('/bubbles/bubbles-bar.css'), false, '9001'); + wp_enqueue_style('bubbles-bar-css'); + } } function bubbles_settings() { @@ -51,6 +56,8 @@ function bubbles_activation() { if ( is_admin() ) { add_action('admin_init', 'bubbles_init'); add_action('admin_menu', 'bubbles_settings'); +} elseif ( !is_admin() && get_option('bar') == 'yes' ) { + add_action('admin_bar_init', 'bubbles_bar_only_init'); } register_activation_hook(__FILE__, 'bubbles_activation');