Changeset 466701
- Timestamp:
- 11/23/2011 08:31:50 PM (14 years ago)
- Location:
- wordpress-admin-bar-improved/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wpabi.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-admin-bar-improved/trunk/readme.txt
r436815 r466701 3 3 Tags: admin bar, top, login form, 3.1+, ajax, search 4 4 Requires at least: 3.1 5 Tested up to: 3.3- aortic-dissection6 Stable tag: 3.3. 35 Tested up to: 3.3-beta3 6 Stable tag: 3.3.4 7 7 8 8 A set of custom tweaks to the WordPress Admin Bar that was introduced in WP3.1. … … 75 75 == ChangeLog == 76 76 77 = 3.3.4 = 78 * Bugfix - custom menu not showing up on Appearance -> Menus page in themes that did not support them natively. 79 77 80 = 3.3.3 = 78 81 * Bugfix - login from and other features now functions properly on 3.2.1 and WP Trunk (beta versions of upcoming release) -
wordpress-admin-bar-improved/trunk/wpabi.php
r436815 r466701 6 6 Plugin URI: http://www.electriceasel.com/wpabi 7 7 Description: A set of custom tweaks to the WordPress Admin Bar that was introduced in WP3.1 8 Version: 3.3. 38 Version: 3.3.4 9 9 Author: dilbert4life, electriceasel 10 10 Author URI: http://www.electriceasel.com/team-member/don-gilbert … … 30 30 31 31 class WPAdminBarImproved { 32 private static $version = '3.3. 3';32 private static $version = '3.3.4'; 33 33 private $textdomain = 'wpabi'; 34 34 private $css_file; … … 82 82 wp_enqueue_style('wpabi_css', plugins_url('wpabi.css', __FILE__), '', '2.0', 'all'); 83 83 84 if($this->options['custom_menu']) 85 { 86 $this->add_custom_menu(); 87 } 88 84 89 add_action('admin_bar_menu', array( &$this, 'manage_menu_items' ), 9998); 85 90 … … 103 108 else 104 109 { 105 $this->login_form_start = '<div id="wpadminbar" class="nojq ">';110 $this->login_form_start = '<div id="wpadminbar" class="nojq nojs">'; 106 111 } 107 112 } … … 122 127 'custom_menu' => 0, 123 128 'default_items' => array( 129 'wp-logo' => 1, 130 'blog-name' => 1, 124 131 'my-account-with-avatar' => 1, 125 132 'view-site' => 1, … … 131 138 'edit' => 1, 132 139 'get-shortlink' => 1, 133 'updates' => 1 140 'updates' => 1, 141 'search' => 1 134 142 ) 135 143 ); … … 150 158 public function wpabi_options_validate($input) 151 159 { 160 // TODO: Validate the inputs, just for fun…. :( 152 161 return $input; 153 162 } 154 163 155 164 public function manage_menu_items($wp_admin_bar) 156 { 165 { 157 166 foreach( (array) $this->options['default_items'] as $menu => $enabled) 158 167 { … … 166 175 $wp_admin_bar->remove_menu('my-account'); 167 176 } 168 }169 170 if($this->options['custom_menu'])171 {172 $this->add_custom_menu();173 177 } 174 178 } … … 201 205 } 202 206 $wp_admin_bar->add_menu($args); 207 } 208 // Little trick to keep search at the end of the menu 209 if(isset($wp_admin_bar->menu->search)) 210 { 211 $tmp_search = $wp_admin_bar->menu->search; 212 unset($wp_admin_bar->menu->search); 213 $tmp_search = array_merge($tmp_search, array('id' => 'search')); 214 $wp_admin_bar->add_menu($tmp_search); 215 unset($tmp_search); 203 216 } 204 217 } … … 459 472 <p><em><?php _e('When you enable this option, you will get a new location added to your "Theme Locations" box on your Appearance -> Menus admin page called "Admin Bar Improved." Use this as you would any other menu location for your site. Create a new menu on the Menus admin page, and name it whatever you\'d like, just keep it easy to identify. Add whatever items to that menu that you want. Nested menu items will work as expected. When you\'re finished, select the menu you created from the select list under the "Admin Bar Improved" theme location. Once completed, (and once you refresh the page, or navigate to another page) you will see that the items you added are now in your admin bar. Good job!', $this->textdomain); ?></em></p> 460 473 </li> 461 474 462 475 <li><h3>Default Menu Items:</h3></li> 476 477 <li class="wp-logo"> 478 <label for="wp-logo"><?php _e('WP Logo', $this->textdomain); ?>:</label> 479 <select name="wpabi_options[default_items][wp-logo]" id="wp-logo"> 480 <option value="1" <?php selected($this->options['default_items']['wp-logo'], '1') ?>>Enabled</option> 481 <option value="0" <?php selected($this->options['default_items']['wp-logo'], '0') ?>>Disabled</option> 482 </select> 483 </li> 484 485 486 <li class="blog-name"> 487 <label for="blog-name"><?php _e('Blog Name', $this->textdomain); ?>:</label> 488 <select name="wpabi_options[default_items][blog-name]" id="blog-name"> 489 <option value="1" <?php selected($this->options['default_items']['blog-name'], '1') ?>>Enabled</option> 490 <option value="0" <?php selected($this->options['default_items']['blog-name'], '0') ?>>Disabled</option> 491 </select> 492 </li> 493 463 494 <li class="my-account-with-avatar"> 464 495 <label for="my-account-with-avatar"><?php _e('My Account', $this->textdomain); ?>:</label> … … 538 569 <option value="1" <?php selected($this->options['default_items']['updates'], '1') ?>>Enabled</option> 539 570 <option value="0" <?php selected($this->options['default_items']['updates'], '0') ?>>Disabled</option> 571 </select> 572 </li> 573 574 <li class="search-field"> 575 <label for="search"><?php _e('Search Field', $this->textdomain); ?>:</label> 576 <select name="wpabi_options[default_items][search]" id="search"> 577 <option value="1" <?php selected($this->options['default_items']['search'], '1') ?>>Enabled</option> 578 <option value="0" <?php selected($this->options['default_items']['search'], '0') ?>>Disabled</option> 540 579 </select> 541 580 </li>
Note: See TracChangeset
for help on using the changeset viewer.