WP Accessibility - Version 1.6.4

Version Description

  • Bug fix: Do not render longdesc UI when no longdesc provided.
Download this release

Release Info

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

Code changes from version 1.6.3 to 1.6.4

readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focu
5
  Requires at least: 3.4.2
6
  Requires PHP: 5.3
7
  Tested up to: 4.9
8
- Stable tag: 1.6.3
9
  Text Domain: wp-accessibility
10
  License: GPLv2 or later
11
 
@@ -65,6 +65,10 @@ 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.3 =
69
 
70
  * Bug fix: incorrect function name
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
  [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.
71
+
72
  = 1.6.3 =
73
 
74
  * Bug fix: incorrect function name
wp-accessibility-longdesc.php CHANGED
@@ -26,18 +26,20 @@ add_filter( 'wp_get_attachment_image_attributes', 'wpa_featured_longdesc', 10, 3
26
  function wpa_featured_longdesc( $attr, $attachment, $size ) {
27
  if ( 'on' == get_option( 'wpa_longdesc_featured' ) ) {
28
  $attachment_id = $attachment->ID;
29
- $args = array( 'longdesc' => $attachment_id );
30
- // The referrer is the post that the image is inserted into.
31
- if ( isset( $_REQUEST['post_id'] ) || get_the_ID() ) {
32
- $id = ( isset( $_REQUEST['post_id'] ) ) ? $_REQUEST['post_id'] : get_the_ID();
33
- $args['referrer'] = intval( $id );
 
 
 
 
 
 
 
 
34
  }
35
-
36
- $target = add_query_arg( $args, home_url() );
37
- $id = wpa_longdesc_return_anchor( $attachment_id );
38
-
39
- $attr['longdesc'] = $target;
40
- $attr['id'] = $id;
41
  }
42
 
43
  return $attr;
@@ -100,8 +102,8 @@ function wpa_longdesc_template() {
100
  if ( ! empty( $template ) ) {
101
  require_once( $template );
102
  exit;
103
- } // Use plugin's template file.
104
- else {
105
  require_once( WPA_TEMPLATES . 'longdesc-template.php' );
106
  exit;
107
  }
@@ -158,7 +160,7 @@ function wpa_longdesc_add_attr( $html, $id, $caption, $title, $align, $url, $siz
158
  $id = ( isset( $_REQUEST['post_id'] ) ) ? $_REQUEST['post_id'] : get_the_ID();
159
  $args['referrer'] = intval( $id );
160
  }
161
- if ( ! empty( $image->post_content ) ) {
162
  $search = '<img ';
163
  $replace = '<img tabindex="-1" id="' . esc_attr( wpa_longdesc_return_anchor( $image->ID ) ) . '" longdesc="' . esc_url( add_query_arg( $args, home_url() ) ) . '" ';
164
  $html = str_replace( $search, $replace, $html );
26
  function wpa_featured_longdesc( $attr, $attachment, $size ) {
27
  if ( 'on' == get_option( 'wpa_longdesc_featured' ) ) {
28
  $attachment_id = $attachment->ID;
29
+ if ( '' != strip_tags( $attachment->post_content ) ) {
30
+ $args = array( 'longdesc' => $attachment_id );
31
+ // The referrer is the post that the image is inserted into.
32
+ if ( isset( $_REQUEST['post_id'] ) || get_the_ID() ) {
33
+ $id = ( isset( $_REQUEST['post_id'] ) ) ? $_REQUEST['post_id'] : get_the_ID();
34
+ $args['referrer'] = intval( $id );
35
+ }
36
+
37
+ $target = add_query_arg( $args, home_url() );
38
+ $id = wpa_longdesc_return_anchor( $attachment_id );
39
+
40
+ $attr['longdesc'] = $target;
41
+ $attr['id'] = $id;
42
  }
 
 
 
 
 
 
43
  }
44
 
45
  return $attr;
102
  if ( ! empty( $template ) ) {
103
  require_once( $template );
104
  exit;
105
+ } else {
106
+ // Use plugin's template file.
107
  require_once( WPA_TEMPLATES . 'longdesc-template.php' );
108
  exit;
109
  }
160
  $id = ( isset( $_REQUEST['post_id'] ) ) ? $_REQUEST['post_id'] : get_the_ID();
161
  $args['referrer'] = intval( $id );
162
  }
163
+ if ( '' != strip_tags( $image->post_content ) ) {
164
  $search = '<img ';
165
  $replace = '<img tabindex="-1" id="' . esc_attr( wpa_longdesc_return_anchor( $image->ID ) ) . '" longdesc="' . esc_url( add_query_arg( $args, home_url() ) ) . '" ';
166
  $html = str_replace( $search, $replace, $html );
wp-accessibility-settings.php CHANGED
@@ -40,7 +40,7 @@ function wpa_write_js() {
40
  }(jQuery));
41
  //]]>
42
  </script>
43
- <?php
44
  }
45
  }
46
 
@@ -190,13 +190,13 @@ function wpa_admin_settings() {
190
  <div class="inside">
191
  <?php
192
  if ( wpa_accessible_theme() && 'on' != get_option( 'asl_enable' ) ) {
193
- ?>
194
  <p>
195
  <?php _e( 'Your <code>accessibility-ready</code> theme has skip links built in.', 'wp-accessibility' ); ?>
196
  </p>
197
- <?php
198
  } else {
199
- ?>
200
  <form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
201
  <fieldset>
202
  <legend><?php _e( 'Configure Skiplinks', 'wp-accessibility' ); ?></legend>
@@ -258,7 +258,7 @@ function wpa_admin_settings() {
258
 
259
  <p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Update Skiplink Settings', 'wp-accessibility' ); ?>"/></p>
260
  </form>
261
- <?php
262
  }
263
  ?>
264
  </div>
@@ -342,7 +342,7 @@ function wpa_admin_settings() {
342
  <ul>
343
  <?php
344
  if ( ! wpa_accessible_theme() ) {
345
- ?>
346
  <li>
347
  <input type="checkbox" id="wpa_lang" name="wpa_lang" <?php checked( get_option( 'wpa_lang' ), 'on' ); ?>/>
348
  <label for="wpa_lang"><?php _e( 'Add Site Language and text direction to HTML element', 'wp-accessibility' ); ?></label>
@@ -363,11 +363,11 @@ function wpa_admin_settings() {
363
  <input type="checkbox" id="wpa_labels" name="wpa_labels" <?php checked( get_option( 'wpa_labels' ), 'on' ); ?> />
364
  <label for='wpa_labels'><?php _e( 'Automatically Label WordPress search form and comment forms', 'wp-accessibility' ); ?></label>
365
  </li>
366
- <?php
367
  } else {
368
- ?>
369
  <li><?php _e( '<strong>Four disabled features:</strong> Site language, continue reading text, landmark roles and standard form labels are defined in your <code>accessibility-ready</code> theme.', 'wp-accessibility' ); ?></li>
370
- <?php
371
  }
372
  ?>
373
  <li>
40
  }(jQuery));
41
  //]]>
42
  </script>
43
+ <?php
44
  }
45
  }
46
 
190
  <div class="inside">
191
  <?php
192
  if ( wpa_accessible_theme() && 'on' != get_option( 'asl_enable' ) ) {
193
+ ?>
194
  <p>
195
  <?php _e( 'Your <code>accessibility-ready</code> theme has skip links built in.', 'wp-accessibility' ); ?>
196
  </p>
197
+ <?php
198
  } else {
199
+ ?>
200
  <form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
201
  <fieldset>
202
  <legend><?php _e( 'Configure Skiplinks', 'wp-accessibility' ); ?></legend>
258
 
259
  <p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Update Skiplink Settings', 'wp-accessibility' ); ?>"/></p>
260
  </form>
261
+ <?php
262
  }
263
  ?>
264
  </div>
342
  <ul>
343
  <?php
344
  if ( ! wpa_accessible_theme() ) {
345
+ ?>
346
  <li>
347
  <input type="checkbox" id="wpa_lang" name="wpa_lang" <?php checked( get_option( 'wpa_lang' ), 'on' ); ?>/>
348
  <label for="wpa_lang"><?php _e( 'Add Site Language and text direction to HTML element', 'wp-accessibility' ); ?></label>
363
  <input type="checkbox" id="wpa_labels" name="wpa_labels" <?php checked( get_option( 'wpa_labels' ), 'on' ); ?> />
364
  <label for='wpa_labels'><?php _e( 'Automatically Label WordPress search form and comment forms', 'wp-accessibility' ); ?></label>
365
  </li>
366
+ <?php
367
  } else {
368
+ ?>
369
  <li><?php _e( '<strong>Four disabled features:</strong> Site language, continue reading text, landmark roles and standard form labels are defined in your <code>accessibility-ready</code> theme.', 'wp-accessibility' ); ?></li>
370
+ <?php
371
  }
372
  ?>
373
  <li>
wp-accessibility.php CHANGED
@@ -17,7 +17,7 @@
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.3
21
  */
22
 
23
  /*
@@ -68,7 +68,7 @@ function wpa_admin_menu() {
68
  * Install on activation.
69
  */
70
  function wpa_install() {
71
- $wpa_version = '1.6.3';
72
  if ( 'true' != get_option( 'wpa_installed' ) ) {
73
  add_option( 'rta_from_nav_menu', 'on' );
74
  add_option( 'rta_from_page_lists', 'on' );
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
  /*
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' );