Skip to content

Commit

Permalink
Merge pull request #4 from roots/show-only-for-admins
Browse files Browse the repository at this point in the history
Only show menu item for administrators, add filter for visibility control
  • Loading branch information
retlehs committed Aug 20, 2014
2 parents ba65ee2 + 54e6fc7 commit e7f733f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.0.3: August 19th, 2014
* Only show menu item for administrators, add filter for visibility control

### 1.0.2: July 22nd, 2014
* Add support for sub-domain subsites in multisite

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ If you use [Bedrock](https://github.com/roots/bedrock), `WP_ENV` is already defi
If you're using Composer to manage WordPress, add wp-stage-switcher to your project's dependencies. Run:

```sh
composer require roots/wp-stage-switcher 1.0.2
composer require roots/wp-stage-switcher 1.0.3
```

Or manually add it to your `composer.json`:

```json
"require": {
"php": ">=5.3.0",
"wordpress": "3.8",
"roots/wp-stage-switcher": "1.0.2"
"wordpress": "3.9.2",
"roots/wp-stage-switcher": "1.0.3"
}
```

Expand Down
4 changes: 2 additions & 2 deletions wp-stage-switcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Stage Switcher
Plugin URI: http://roots.io/plugins/stage-switcher/
Description: A WordPress plugin that allows you to switch between different environments from the admin bar.
Version: 1.0.2
Version: 1.0.3
Author: Ben Word
Author URI: http://roots.io/
License: MIT License
Expand All @@ -28,7 +28,7 @@
* WP_ENV must be defined as the current environment
*/
function admin_bar_stage_switcher($admin_bar) {
if (defined('ENVIRONMENTS') && defined('WP_ENV')) {
if (defined('ENVIRONMENTS') && defined('WP_ENV') && apply_filters('bedrock_stage_switcher_visibility', is_super_admin())) {
$stages = unserialize(ENVIRONMENTS);
$current_stage = WP_ENV;
} else {
Expand Down

0 comments on commit e7f733f

Please sign in to comment.