Skip to content

Commit

Permalink
Merge pull request #1 from 2ndkauboy/master
Browse files Browse the repository at this point in the history
minor code improvements
  • Loading branch information
apermo committed Jun 29, 2016
2 parents 6d44122 + 0eeb464 commit c2678cf
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 68 deletions.
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# apermo-adminbar
This is a WordPress plugin, that adds links between your different development versions of your website.
# Apermo AdminBar #
* Contributors: apermo
* Tags: admin bar, admin, development, staging
* Requires at least: 4.0
* Tested up to: 4.5.3
* Stable tag: 0.9.0
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html

This plugin lets allows you to add links between a development, staging and live version of your website, and adds them to the AdminBar

## Description ##

This plugin alters the AdminBar and adds links to development, staging and live version of your website, furthermore it allows you to choose a color scheme of your AdminBar for all users on a website, including the frontend

If you want to participate in the development [head over to GitHub](https://github.com/apermo/apermo-adminbar)!

## Installation ##

1. Upload the plugin files to the `/wp-content/plugins/apermo-adminbar` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the 'Apermo AdminBar' plugin through the 'Plugins' menu in WordPress
3. Open Settings -> Apermo AdminBar to set up the links and colors (currently you have to repeat this on all sites)

## Frequently Asked Questions ##

### How can I help with the development of this plugin? ###
Head over to the [GitHub Repository](https://github.com/apermo/apermo-adminbar) and start reading. Every bit of help is highly appreciated!

### I have more than 3 sites, can I add more? ###
You can do so with `add_filter( 'ap-ab-type', 'your_filter' );`

### I want more color schemes! ###
Feel free to add more, there are other plugins that do so. Or have a look at [wp_admin_css_color() in the WordPress Codex](https://codex.wordpress.org/Function_Reference/wp_admin_css_color)

## Changelog ##

### 0.9.2 ###
* Some minor code improvements

### 0.9.1 ###
* Bug fixes and optimizations - Thanks to @kau-boy for the help

### 0.9.0 ###
* Initial Release
40 changes: 22 additions & 18 deletions apermo-adminbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* Apermo Adminbar
*
* @package apermo-adminbar
*/

/**
*
* @wordpress-plugin
* Plugin Name: Apermo Admin Bar
* Version: 0.9.1
* Description: A simple plugin that allows you to add custom links to the admin bar, navigation between your live and dev systems
* Author: Christoph Daum
* Author URI: http://apermo.de/
* Text Domain: apermo-adminbar
* Domain Path: /languages/
* License: GPL v3
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/**
Expand Down Expand Up @@ -74,7 +74,7 @@ class ApermoAdminBar {
*/
public function __construct() {
$this->sites = get_option( 'apermo_adminbar_sites', array() );
add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain' ) );
$this->load_translation();

add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
add_action( 'admin_init', array( $this, 'settings_init' ) );
Expand All @@ -91,9 +91,8 @@ public function __construct() {
*
* Thanks to @kau-boy
*/
public function load_plugin_textdomain() {
$domain = 'apermo-adminbar';
load_plugin_textdomain( $domain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
public function load_translation() {
load_plugin_textdomain( 'apermo-adminbar', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}

/**
Expand Down Expand Up @@ -254,14 +253,16 @@ public function admin_bar_filter( $wp_admin_bar ) {
*/
public function options_page() {
?>
<form action='options.php' method='post'>
<h1><?php esc_html_e( 'Apermo Admin Bar', 'apermo-adminbar' ); ?></h1>
<?php
settings_fields( 'apermo_adminbar' );
do_settings_sections( 'apermo_adminbar' );
submit_button();
?>
</form>
<div class="wrap">
<form action='options.php' method='post'>
<h1><?php esc_html_e( 'Apermo Admin Bar', 'apermo-adminbar' ); ?></h1>
<?php
settings_fields( 'apermo_adminbar' );
do_settings_sections( 'apermo_adminbar' );
submit_button();
?>
</form>
</div>
<?php
}

Expand Down Expand Up @@ -361,7 +362,7 @@ public function color_render( $args ) {
}
?>
<fieldset id="color-picker" class="scheme-list">
<legend class="screen-reader-text"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>
<legend class="screen-reader-text"><span><?php esc_html_e( 'Admin Color Scheme' ); ?></span></legend>
<?php
wp_nonce_field( 'save-color-scheme', 'color-nonce', false );
foreach ( $this->admin_colors as $color => $color_info ) :
Expand Down Expand Up @@ -431,4 +432,7 @@ public function sanitize( $input ) {
}

// Run boy, run!
new ApermoAdminBar();
add_action( 'plugins_loaded', function () {
new ApermoAdminBar();
} );

5 changes: 1 addition & 4 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
// Silence is golden.
44 changes: 0 additions & 44 deletions readme.txt

This file was deleted.

0 comments on commit c2678cf

Please sign in to comment.