wp-local-toolbox
wp-local-toolbox copied to clipboard
Keep WPLT_AIRPLANE in sync with norcross/airplane-mode
Keeping WPLT's version of Airplane Mode in sync is an ongoing task.
Airplane Mode repo: https://github.com/norcross/airplane-mode/
Changes that need to be applied to Airplane Mode for WPLT:
- Only use the Airplane Mode class, included in WPLT as https://github.com/joeguilmette/wp-local-toolbox/blob/master/toolbox/inc/WPLT_Airplane_Mode_Core.php
- Remove enqueing CSS files
- Change toggle indicator to checkmark
- Remove $count from $icon
- Add $count to end of $title
- Move $title creation to after $count creation
// get the HTTP count
if ( ! empty( $this->http_count ) ) {
$count = number_format_i18n( $this->http_count );
$title .= sprintf( _n( ' There was %s http request.', ' There were %s http requests.', $count, 'airplane-mode' ), $count );
$count = '<span class="airplane-http-count">' . $count . '</span>';
} else {
$count = '';
$title .= __( ' There were no http requests.', 'airplane-mode' );
}
// get my text
$text = __( 'Airplane Mode', 'airplane-mode' ) . $count;
// get my icon
$icon = '<span class="airplane-toggle-icon ' . sanitize_html_class( $class ) . '"></span>';
What a nightmare.
What about this is "nightmare"? If it's a change needed to Airplane mode we can send a PR to Norcross and I'm pretty sure I can him to merge it...
If you want to roll the recent changes to https://github.com/norcross/airplane-mode/ in to WPLT, that's great. I just didn't see that we were missing out on much and it was going to be a lot of work to merge everything they've done in to WPLT.