Skip to content

Commit

Permalink
minor tweak to include CSS for new icon font
Browse files Browse the repository at this point in the history
  • Loading branch information
norcross committed Apr 25, 2016
1 parent aef5792 commit 45259cd
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### Version 0.1.6 - 2016/04/25
* minor tweak to include CSS for new icon font

#### Version 0.1.5 - 2016/04/24
* adding custom icon font for display and removing label. props @barryceelen

Expand Down
37 changes: 28 additions & 9 deletions airplane-mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Control loading of external files when developing locally
* Author: Andrew Norcross
* Author URI: http://reaktivstudios.com/
* Version: 0.1.5
* Version: 0.1.6
* Text Domain: airplane-mode
* Requires WP: 4.0
* Domain Path: languages
Expand Down Expand Up @@ -45,7 +45,7 @@
}

if ( ! defined( 'AIRMDE_VER' ) ) {
define( 'AIRMDE_VER', '0.1.5' );
define( 'AIRMDE_VER', '0.1.6' );
}

if ( ! class_exists( 'Airplane_Mode_Core' ) ) {
Expand Down Expand Up @@ -342,26 +342,45 @@ public function block_oembed_html( $html, $url, $attr, $post_ID ) {
}

/**
* Add body class to front-end pages and login based on plugin status
* Add body class to front-end pages and login based on plugin status.
*
* @return string our new class appended to the existing string
* @param array $classes The existing array of body classes.
*
* @return array $classes The updated array of body classes.
*/
public function body_class() {
public function body_class( $classes ) {

// Add the class based on the current status.
$classes[] = $this->enabled() ? 'airplane-mode-enabled' : 'airplane-mode-disabled';

// Also add in the margin setup for Query Monitor because I'm a perfectionist.
if ( ! class_exists( 'QueryMonitor' ) || defined( 'QM_DISABLED' ) && QM_DISABLED ) {
$classes[] = 'airplane-mode-no-qm';
}

// Return our array of classes.
return $classes;
}

/**
* Add body class to admin pages based on plugin status
* Add body class to admin pages based on plugin status.
*
* @param string $classes The existing space-separated list of CSS classes.
*
* @return string our new class appended to the existing string
* @return string $classes The updated space-separated list of CSS classes.
*/
public function admin_body_class() {
return $this->enabled() ? ' airplane-mode-enabled' : ' airplane-mode-disabled';
public function admin_body_class( $classes ) {

// First add the standard set of classes based on status.
$classes .= $this->enabled() ? ' airplane-mode-enabled' : ' airplane-mode-disabled';

// Also add in the margin setup for Query Monitor because I'm a perfectionist.
if ( ! class_exists( 'QueryMonitor' ) || defined( 'QM_DISABLED' ) && QM_DISABLED ) {
$classes .= ' airplane-mode-no-qm';
}

// Return our string of classes.
return $classes;
}

/**
Expand Down
12 changes: 12 additions & 0 deletions lib/css/airplane-mode.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
content: "\e001";
}

#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default > #wp-admin-bar-airplane-mode-toggle .ab-icon,
#wpadminbar #wp-admin-bar-airplane-mode-toggle .ab-icon,
#wpadminbar #wp-admin-bar-airplane-mode-toggle .ab-item::before {
margin-right: 0;
}

.airplane-mode-no-qm #wpadminbar > #wp-toolbar > #wp-admin-bar-root-default > #wp-admin-bar-airplane-mode-toggle .ab-icon,
.airplane-mode-no-qm #wpadminbar #wp-admin-bar-airplane-mode-toggle .ab-icon,
.airplane-mode-no-qm #wpadminbar #wp-admin-bar-airplane-mode-toggle .ab-item::before {
margin-right: 6px;
}

/* Set the opacity to mimic comment moderation queue. */
.airplane-mode-disabled #wp-admin-bar-airplane-mode-toggle .ab-label {
/* Theoretically for IE 8 & 9 (more valid) */
Expand Down
2 changes: 1 addition & 1 deletion lib/css/airplane-mode.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Donate link: https://andrewnorcross.com/donate
Tags: external calls, HTTP
Requires at least: 4.0
Tested up to: 4.5
Stable tag: 0.1.5
Stable tag: 0.1.6
License: MIT
License URI: http://norcross.mit-license.org/

Expand Down Expand Up @@ -43,6 +43,9 @@ Because you are a jet set developer who needs to work without internet.

== Changelog ==

= 0.1.6 - 2016/04/25
* minor tweak to include CSS for new icon font

= 0.1.5 - 2016/04/24
* adding custom icon font for display and removing label. props @barryceelen

Expand Down

0 comments on commit 45259cd

Please sign in to comment.