WP Accessibility - Version 1.6.5

Version Description

  • Bug fix: Widget output should not be styled.
  • Bug fix: Remove duplicated (current) when both current-menu-item and -page-item present (props loopRW)
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 WP Accessibility
Version 1.6.5
Comparing to
See all releases

Code changes from version 1.6.4 to 1.6.5

js/current-menu-item.js CHANGED
@@ -1,6 +1,5 @@
1
  (function ($) {
2
  $(function() {
3
- $( '.current-menu-item' ).attr( 'aria-current', 'true' ).append( "<span class='screen-reader-text'>(current)</span>" );
4
- $( '.current_page_item' ).attr( 'aria-current', 'true' ).append( "<span class='screen-reader-text'>(current)</span>" );
5
  });
6
- }(jQuery));
1
  (function ($) {
2
  $(function() {
3
+ $( '.current-menu-item a, .current_page_item a' ).attr( 'aria-current', 'true' ).append( "<span class='screen-reader-text'>(current)</span>" );
 
4
  });
5
+ }(jQuery));
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.joedolson.com/donate/
4
  Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focus, alt text, labels, aria
5
  Requires at least: 3.4.2
6
  Requires PHP: 5.3
7
- Tested up to: 4.9
8
- Stable tag: 1.6.4
9
  Text Domain: wp-accessibility
10
  License: GPLv2 or later
11
 
@@ -65,6 +65,11 @@ The plug-in is intended to help with deficiencies commonly found in themes and t
65
  [Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
66
  * Conflict with NextGen gallery to explore
67
 
 
 
 
 
 
68
  = 1.6.4 =
69
 
70
  * Bug fix: Do not render longdesc UI when no longdesc provided.
4
  Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focus, alt text, labels, aria
5
  Requires at least: 3.4.2
6
  Requires PHP: 5.3
7
+ Tested up to: 5.0
8
+ Stable tag: 1.6.5
9
  Text Domain: wp-accessibility
10
  License: GPLv2 or later
11
 
65
  [Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
66
  * Conflict with NextGen gallery to explore
67
 
68
+ = 1.6.5 =
69
+
70
+ * Bug fix: Widget output should not be styled.
71
+ * Bug fix: Remove duplicated (current) when both current-menu-item and -page-item present (props loopRW)
72
+
73
  = 1.6.4 =
74
 
75
  * Bug fix: Do not render longdesc UI when no longdesc provided.
wp-accessibility-settings.php CHANGED
@@ -210,22 +210,24 @@ function wpa_admin_settings() {
210
  <label for="asl_visible"><?php _e( 'Skiplinks always visible', 'wp-accessibility' ); ?></label>
211
  </li>
212
  <li>
213
- <label for="asl_content"><?php _e( 'Skip to Content link target (ID of your main content container)', 'wp-accessibility' ); ?></label>
214
- <input type="text" id="asl_content" name="asl_content" value="<?php echo esc_attr( get_option( 'asl_content' ) ); ?>"/>
215
  </li>
216
  <li>
217
- <label for="asl_navigation"><?php _e( 'Skip to Navigation link target (ID of your main navigation container)', 'wp-accessibility' ); ?></label>
218
- <input type="text" id="asl_navigation" name="asl_navigation" value="<?php echo esc_attr( get_option( 'asl_navigation' ) ); ?>"/>
219
  </li>
220
  <li>
221
- <label for="asl_sitemap"><?php _e( 'Site Map link target (URL for your site map)', 'wp-accessibility' ); ?></label>
222
  <input type="text" id="asl_sitemap" name="asl_sitemap" size="44" value="<?php echo esc_attr( get_option( 'asl_sitemap' ) ); ?>"/>
223
  </li>
224
  <li>
225
- <label for="asl_extra_target"><?php _e( 'Add your own link (link or container ID)', 'wp-accessibility' ); ?></label>
226
- <input type="text" id="asl_extra_target" name="asl_extra_target" value="<?php echo esc_attr( get_option( 'asl_extra_target' ) ); ?>"/>
227
- <label for="asl_extra_text"><?php _e( 'Link text for your link', 'wp-accessibility' ); ?></label>
228
- <input type="text" id="asl_extra_text" name="asl_extra_text" value="<?php echo esc_attr( get_option( 'asl_extra_text' ) ); ?>"/>
 
 
229
  </li>
230
  <li>
231
  <label for="asl_styles_focus"><?php _e( 'Styles for Skiplinks when they have focus', 'wp-accessibility' ); ?></label><br/>
@@ -287,7 +289,7 @@ function wpa_admin_settings() {
287
  </ul>
288
  </li>
289
  <li>
290
- <label for="wpa_toolbar_default"><?php _e( 'Toolbar location (ID attribute)', 'wp-accessibility' ); ?></label>
291
  <input type="text" id="wpa_toolbar_default" name="wpa_toolbar_default" value="<?php echo esc_attr( get_option( 'wpa_toolbar_default' ) ); ?>" />
292
  </li>
293
  <?php
210
  <label for="asl_visible"><?php _e( 'Skiplinks always visible', 'wp-accessibility' ); ?></label>
211
  </li>
212
  <li>
213
+ <label for="asl_content"><?php _e( 'Skip to Content link target (ID of your main content container)', 'wp-accessibility' ); ?></label><br />
214
+ <input type="text" id="asl_content" name="asl_content" size="44" value="<?php echo esc_attr( get_option( 'asl_content' ) ); ?>"/>
215
  </li>
216
  <li>
217
+ <label for="asl_navigation"><?php _e( 'Skip to Navigation link target (ID of your main navigation container)', 'wp-accessibility' ); ?></label><br />
218
+ <input type="text" id="asl_navigation" name="asl_navigation" size="44" value="<?php echo esc_attr( get_option( 'asl_navigation' ) ); ?>"/>
219
  </li>
220
  <li>
221
+ <label for="asl_sitemap"><?php _e( 'Site Map link target (URL for your site map)', 'wp-accessibility' ); ?></label><br />
222
  <input type="text" id="asl_sitemap" name="asl_sitemap" size="44" value="<?php echo esc_attr( get_option( 'asl_sitemap' ) ); ?>"/>
223
  </li>
224
  <li>
225
+ <label for="asl_extra_target"><?php _e( 'Add your own link (link or container ID)', 'wp-accessibility' ); ?></label><br />
226
+ <input type="text" id="asl_extra_target" name="asl_extra_target" size="44" value="<?php echo esc_attr( get_option( 'asl_extra_target' ) ); ?>"/>
227
+ </li>
228
+ <li>
229
+ <label for="asl_extra_text"><?php _e( 'Link text for your link', 'wp-accessibility' ); ?></label><br />
230
+ <input type="text" id="asl_extra_text" name="asl_extra_text" size="44" value="<?php echo esc_attr( get_option( 'asl_extra_text' ) ); ?>"/>
231
  </li>
232
  <li>
233
  <label for="asl_styles_focus"><?php _e( 'Styles for Skiplinks when they have focus', 'wp-accessibility' ); ?></label><br/>
289
  </ul>
290
  </li>
291
  <li>
292
+ <label for="wpa_toolbar_default"><?php _e( 'Toolbar location (ID attribute, such as <code>#header</code>)', 'wp-accessibility' ); ?></label>
293
  <input type="text" id="wpa_toolbar_default" name="wpa_toolbar_default" value="<?php echo esc_attr( get_option( 'wpa_toolbar_default' ) ); ?>" />
294
  </li>
295
  <?php
wp-accessibility-toolbar.php CHANGED
@@ -9,15 +9,37 @@
9
  * @link https://www.joedolson.com/wp-accessibility/
10
  */
11
 
12
- add_shortcode( 'wpa_toolbar', 'wpa_toolbar_html' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  /**
14
  * Generate Toolbar as HTML.
15
  *
16
- * @param string $type widget, shortcode, or button.
 
17
  *
18
  * @return string HTML.
19
  */
20
- function wpa_toolbar_html( $type = 'widget' ) {
21
  $contrast = __( 'Toggle High Contrast', 'wp-accessibility' );
22
  $grayscale = __( 'Toggle Grayscale', 'wp-accessibility' );
23
  $fontsize = __( 'Toggle Font size', 'wp-accessibility' );
@@ -28,20 +50,20 @@ function wpa_toolbar_html( $type = 'widget' ) {
28
  $is_rtl = ( is_rtl() ) ? ' rtl' : ' ltr';
29
  $is_right = ( 'on' == get_option( 'wpa_toolbar_right' ) ) ? ' right' : ' left';
30
  $toolbar_type = ( 'widget' == $type ) ? 'a11y-toolbar-widget' : 'a11y-toolbar';
31
- $control_type = ( 'button' != $type ) ? 'a href="#" role="button"' : 'button type="button"'; // button control does not work in Edge.
32
- $closure = ( 'button' != $type ) ? 'a' : 'button'; // button control does not work in Edge.
33
  $toolbar = '
34
  <!-- a11y toolbar widget -->
35
  <div class="' . $responsive . ' ' . $is_rtl . ' ' . $is_right . ' ' . $toolbar_type . '">
36
  <ul>';
37
  if ( $enable_contrast ) {
38
- $toolbar .= '<li><' . $control_type . ' class="a11y-toggle-contrast toggle-contrast" id="is_normal_contrast" aria-pressed="false"><span class="offscreen">' . $contrast . '</span><span class="aticon aticon-adjust" aria-hidden="true"></span></' . $closure . '></li>';
39
  }
40
  if ( $enable_grayscale ) {
41
- $toolbar .= '<li><' . $control_type . ' class="a11y-toggle-grayscale toggle-grayscale" id="is_normal_color" aria-pressed="false"><span class="offscreen">' . $grayscale . '</span><span class="aticon aticon-tint" aria-hidden="true"></span></' . $closure . '></li>';
42
  }
43
  if ( $enable_fontsize ) {
44
- $toolbar .= '<li><' . $control_type . ' class="a11y-toggle-fontsize toggle-fontsize" id="is_normal_fontsize" aria-pressed="false"><span class="offscreen">' . $fontsize . '</span><span class="aticon aticon-font" aria-hidden="true"></span></' . $closure . '></li>';
45
  }
46
  $toolbar .= '
47
  </ul>
@@ -64,7 +86,7 @@ function wpa_toolbar_js() {
64
  $responsive = ( 'on' == get_option( 'wpa_toolbar_mobile' ) ) ? 'a11y-responsive ' : 'a11y-non-responsive ';
65
 
66
  if ( preg_match( '/Edge/i', $user_agent ) ) {
67
- echo wpa_toolbar_html( 'js' );
68
  echo "
69
  <script type='text/javascript'>
70
  //<![CDATA[
9
  * @link https://www.joedolson.com/wp-accessibility/
10
  */
11
 
12
+ add_shortcode( 'wpa_toolbar', 'wpa_toolbar_shortcode' );
13
+ /**
14
+ * Output Toolbar shortcode
15
+ *
16
+ * @param array $atts Shortcode attributes.
17
+ * @param string $content Contained content.
18
+ *
19
+ * @return string
20
+ */
21
+ function wpa_toolbar_shortcode( $atts, $content ) {
22
+ $args = shortcode_atts(
23
+ array(
24
+ 'type' => 'widget',
25
+ 'control' => 'button',
26
+ ),
27
+ $atts,
28
+ 'wpa_toolbar'
29
+ );
30
+
31
+ return wpa_toolbar_html( $args['type'], $args['control'] );
32
+ }
33
+
34
  /**
35
  * Generate Toolbar as HTML.
36
  *
37
+ * @param string $type widget, shortcode, js generated.
38
+ * @param string $control Control type: button or not.
39
  *
40
  * @return string HTML.
41
  */
42
+ function wpa_toolbar_html( $type = 'widget', $control = 'button' ) {
43
  $contrast = __( 'Toggle High Contrast', 'wp-accessibility' );
44
  $grayscale = __( 'Toggle Grayscale', 'wp-accessibility' );
45
  $fontsize = __( 'Toggle Font size', 'wp-accessibility' );
50
  $is_rtl = ( is_rtl() ) ? ' rtl' : ' ltr';
51
  $is_right = ( 'on' == get_option( 'wpa_toolbar_right' ) ) ? ' right' : ' left';
52
  $toolbar_type = ( 'widget' == $type ) ? 'a11y-toolbar-widget' : 'a11y-toolbar';
53
+ $control_type = ( 'button' != $control ) ? 'a href="#" role="button"' : 'button type="button"'; // button control does not work in Edge.
54
+ $closure = ( 'button' != $control ) ? 'a' : 'button'; // button control does not work in Edge.
55
  $toolbar = '
56
  <!-- a11y toolbar widget -->
57
  <div class="' . $responsive . ' ' . $is_rtl . ' ' . $is_right . ' ' . $toolbar_type . '">
58
  <ul>';
59
  if ( $enable_contrast ) {
60
+ $toolbar .= '<li><' . $control_type . ' class="a11y-toggle-contrast toggle-contrast" id="is_normal_contrast" aria-pressed="false"><span class="offscreen">' . $contrast . '</span> <span class="aticon aticon-adjust" aria-hidden="true"></span></' . $closure . '></li>';
61
  }
62
  if ( $enable_grayscale ) {
63
+ $toolbar .= '<li><' . $control_type . ' class="a11y-toggle-grayscale toggle-grayscale" id="is_normal_color" aria-pressed="false"><span class="offscreen">' . $grayscale . '</span> <span class="aticon aticon-tint" aria-hidden="true"></span></' . $closure . '></li>';
64
  }
65
  if ( $enable_fontsize ) {
66
+ $toolbar .= '<li><' . $control_type . ' class="a11y-toggle-fontsize toggle-fontsize" id="is_normal_fontsize" aria-pressed="false"><span class="offscreen">' . $fontsize . '</span> <span class="aticon aticon-font" aria-hidden="true"></span></' . $closure . '></li>';
67
  }
68
  $toolbar .= '
69
  </ul>
86
  $responsive = ( 'on' == get_option( 'wpa_toolbar_mobile' ) ) ? 'a11y-responsive ' : 'a11y-non-responsive ';
87
 
88
  if ( preg_match( '/Edge/i', $user_agent ) ) {
89
+ echo wpa_toolbar_html( 'js', 'a' );
90
  echo "
91
  <script type='text/javascript'>
92
  //<![CDATA[
wp-accessibility.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WP Accessibility
6
  * @author Joe Dolson
7
- * @copyright 2012-2018 Joe Dolson
8
  * @license GPL-2.0+
9
  *
10
  * @wordpress-plugin
@@ -17,11 +17,11 @@
17
  * Domain Path: /lang
18
  * License: GPL-2.0+
19
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
20
- * Version: 1.6.4
21
  */
22
 
23
  /*
24
- Copyright 2012-2018 Joe Dolson (email : joe@joedolson.com)
25
 
26
  This program is free software; you can redistribute it and/or modify
27
  it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ function wpa_admin_menu() {
68
  * Install on activation.
69
  */
70
  function wpa_install() {
71
- $wpa_version = '1.6.4';
72
  if ( 'true' != get_option( 'wpa_installed' ) ) {
73
  add_option( 'rta_from_nav_menu', 'on' );
74
  add_option( 'rta_from_page_lists', 'on' );
4
  *
5
  * @package WP Accessibility
6
  * @author Joe Dolson
7
+ * @copyright 2012-2019 Joe Dolson
8
  * @license GPL-2.0+
9
  *
10
  * @wordpress-plugin
17
  * Domain Path: /lang
18
  * License: GPL-2.0+
19
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
20
+ * Version: 1.6.5
21
  */
22
 
23
  /*
24
+ Copyright 2012-2019 Joe Dolson (email : joe@joedolson.com)
25
 
26
  This program is free software; you can redistribute it and/or modify
27
  it under the terms of the GNU General Public License as published by
68
  * Install on activation.
69
  */
70
  function wpa_install() {
71
+ $wpa_version = '1.6.5';
72
  if ( 'true' != get_option( 'wpa_installed' ) ) {
73
  add_option( 'rta_from_nav_menu', 'on' );
74
  add_option( 'rta_from_page_lists', 'on' );