Version Description
- Change: mark
as an invalid alt value. - Remove .hndle class on admin headings.
- Fix jQuery incompatibility due to deprecated .toggle() event handler.
- Add support for long description in the block editor.
Download this release
Release Info
Developer | joedolson |
Plugin | WP Accessibility |
Version | 1.7.4 |
Comparing to | |
See all releases |
Code changes from version 1.7.3 to 1.7.4
- js/longdesc.button.js +67 -13
- js/longdesc.link.js +46 -1
- readme.txt +9 -2
- templates/longdesc-template.php +1 -1
- wp-accessibility-alt.php +1 -0
- wp-accessibility-longdesc.php +12 -0
- wp-accessibility-settings.php +458 -460
- wp-accessibility.php +5 -2
js/longdesc.button.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
'use strict';
|
3 |
$('img[longdesc]').each(function () {
|
4 |
var longdesc = $(this).attr('longdesc');
|
5 |
-
var
|
6 |
-
var classes =
|
7 |
var class_array = ( Array.isArray(classes) ) ? classes.split(' ') : [];
|
8 |
var image_id = '';
|
9 |
$.each( class_array, function ( index, value ) {
|
@@ -11,17 +11,71 @@
|
|
11 |
image_id = value;
|
12 |
}
|
13 |
});
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
});
|
26 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}(jQuery));
|
2 |
'use strict';
|
3 |
$('img[longdesc]').each(function () {
|
4 |
var longdesc = $(this).attr('longdesc');
|
5 |
+
var img = $(this);
|
6 |
+
var classes = img.attr('class');
|
7 |
var class_array = ( Array.isArray(classes) ) ? classes.split(' ') : [];
|
8 |
var image_id = '';
|
9 |
$.each( class_array, function ( index, value ) {
|
11 |
image_id = value;
|
12 |
}
|
13 |
});
|
14 |
+
img.attr('class', '');
|
15 |
+
img.wrap('<div class="wpa-ld" />')
|
16 |
+
img.parent('.wpa-ld').addClass(classes);
|
17 |
+
img.parent('.wpa-ld').append('<div class="longdesc" aria-live="assertive"></div>');
|
18 |
+
img.parent('.wpa-ld').append('<button>' + wpatext + '</button>');
|
19 |
+
var container = img.parent('.wpa-ld').children('.longdesc');
|
20 |
+
container.hide();
|
21 |
+
container.load( longdesc + ' #desc_' + image_id );
|
22 |
+
img.parent('.wpa-ld').children('button').on( 'click', function(e) {
|
23 |
+
e.preventDefault();
|
24 |
+
var visible = container.is( ':visible' );
|
25 |
+
if ( visible ) {
|
26 |
+
container.hide();
|
27 |
+
} else {
|
28 |
+
container.show(150);
|
29 |
+
}
|
30 |
});
|
31 |
});
|
32 |
+
|
33 |
+
$( 'figure.is-style-longdesc' ).each(function() {
|
34 |
+
var img = $(this).find( 'img' );
|
35 |
+
wpa_load_image( img );
|
36 |
+
});
|
37 |
+
|
38 |
+
function wpa_draw_longdesc( img, image_id, longdesc ) {
|
39 |
+
var classes = img.attr('class');
|
40 |
+
var class_array = ( Array.isArray(classes) ) ? classes.split(' ') : [];
|
41 |
+
img.attr('class', '').attr('longdesc', longdesc );
|
42 |
+
img.attr('id','longdesc-return-' + image_id );
|
43 |
+
img.wrap('<div class="wpa-ld" />')
|
44 |
+
img.parent('.wpa-ld').addClass(classes);
|
45 |
+
img.parent('.wpa-ld').append('<div class="longdesc" aria-live="assertive"></div>');
|
46 |
+
img.parent('.wpa-ld').append('<button>' + wpatext + '</button>');
|
47 |
+
var container = img.parent('.wpa-ld').children('.longdesc');
|
48 |
+
container.hide();
|
49 |
+
container.load( longdesc + ' #desc_' + image_id );
|
50 |
+
console.log( longdesc + ' #desc_' + image_id );
|
51 |
+
img.parent('.wpa-ld').children('button').on( 'click', function(e) {
|
52 |
+
e.preventDefault();
|
53 |
+
var visible = container.is( ':visible' );
|
54 |
+
if ( visible ) {
|
55 |
+
container.hide();
|
56 |
+
} else {
|
57 |
+
container.show(150);
|
58 |
+
}
|
59 |
+
});
|
60 |
+
}
|
61 |
+
|
62 |
+
function wpa_load_image( img ) {
|
63 |
+
var id = img.attr( 'class' ).replace( 'wp-image-', '' );
|
64 |
+
var api = wparest + '/' + id;
|
65 |
+
|
66 |
+
$.get( api )
|
67 |
+
.done( function( response ) {
|
68 |
+
var attachment = {
|
69 |
+
attachment: response
|
70 |
+
}
|
71 |
+
|
72 |
+
var url = new URL( response.link );
|
73 |
+
url.searchParams.set( 'longdesc', id );
|
74 |
+
url.toString();
|
75 |
+
wpa_draw_longdesc( img, id, url );
|
76 |
+
})
|
77 |
+
.fail( function() {
|
78 |
+
alert( 'cannot load media' )
|
79 |
+
});
|
80 |
+
}
|
81 |
}(jQuery));
|
js/longdesc.link.js
CHANGED
@@ -8,5 +8,50 @@
|
|
8 |
$(this).parent('.wpa-ld').addClass(classes);
|
9 |
$(this).attr('alt', '').attr('class', '');
|
10 |
$(this).parent('.wpa-ld').append('<a href="' + longdesc + '" class="longdesc-link">Description<span> of' + alt + '</span></a>');
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
}(jQuery));
|
8 |
$(this).parent('.wpa-ld').addClass(classes);
|
9 |
$(this).attr('alt', '').attr('class', '');
|
10 |
$(this).parent('.wpa-ld').append('<a href="' + longdesc + '" class="longdesc-link">Description<span> of' + alt + '</span></a>');
|
11 |
+
});
|
12 |
+
|
13 |
+
$( 'figure.is-style-longdesc' ).each(function() {
|
14 |
+
var img = $(this).find( 'img' );
|
15 |
+
wpa_load_image( img );
|
16 |
+
});
|
17 |
+
|
18 |
+
function wpa_draw_longdesc( img, image_id, longdesc ) {
|
19 |
+
var alt = img.attr('alt');
|
20 |
+
var post_classes = document.body.className.split(/\s+/);
|
21 |
+
var post_id = '';
|
22 |
+
console.log( post_classes );
|
23 |
+
$.each( post_classes, function ( index, value ) {
|
24 |
+
if ( value.match( /postid-/gi ) ) {
|
25 |
+
post_id = value.replace( 'postid-', '', value );
|
26 |
+
}
|
27 |
+
});
|
28 |
+
var url = new URL(longdesc);
|
29 |
+
url.searchParams.set('referrer',post_id );
|
30 |
+
url.toString();
|
31 |
+
var classes = img.attr('class');
|
32 |
+
img.wrap('<div class="wpa-ld" />');
|
33 |
+
img.parent('.wpa-ld').addClass(classes);
|
34 |
+
img.attr('alt', '').attr('class', '');
|
35 |
+
img.parent('.wpa-ld').append('<a href="' + url + '" class="longdesc-link">Description<span> of' + alt + '</span></a>');
|
36 |
+
}
|
37 |
+
|
38 |
+
function wpa_load_image( img ) {
|
39 |
+
var id = img.attr( 'class' ).replace( 'wp-image-', '' );
|
40 |
+
var api = wparest + '/' + id;
|
41 |
+
|
42 |
+
$.get( api )
|
43 |
+
.done( function( response ) {
|
44 |
+
var attachment = {
|
45 |
+
attachment: response
|
46 |
+
}
|
47 |
+
|
48 |
+
var url = new URL( response.link );
|
49 |
+
url.searchParams.set( 'longdesc', id );
|
50 |
+
url.toString();
|
51 |
+
wpa_draw_longdesc( img, id, url );
|
52 |
+
})
|
53 |
+
.fail( function() {
|
54 |
+
alert( 'cannot load media' )
|
55 |
+
});
|
56 |
+
}
|
57 |
}(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: 5.
|
8 |
-
Stable tag: 1.7.
|
9 |
Text Domain: wp-accessibility
|
10 |
License: GPLv2 or later
|
11 |
|
@@ -74,6 +74,13 @@ The plug-in is intended to help with deficiencies commonly found in themes and t
|
|
74 |
|
75 |
[Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
= 1.7.3 =
|
78 |
|
79 |
* Bug fix: script registration/enqueuing mis-ordered, breaking toolbar.
|
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.6
|
8 |
+
Stable tag: 1.7.4
|
9 |
Text Domain: wp-accessibility
|
10 |
License: GPLv2 or later
|
11 |
|
74 |
|
75 |
[Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
|
76 |
|
77 |
+
= 1.7.4 =
|
78 |
+
|
79 |
+
* Change: mark ` ` as an invalid alt value.
|
80 |
+
* Remove .hndle class on admin headings.
|
81 |
+
* Fix jQuery incompatibility due to deprecated .toggle() event handler.
|
82 |
+
* Add support for long description in the block editor.
|
83 |
+
|
84 |
= 1.7.3 =
|
85 |
|
86 |
* Bug fix: script registration/enqueuing mis-ordered, breaking toolbar.
|
templates/longdesc-template.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
</head>
|
25 |
<body>
|
26 |
<div id="longdesc" class="template-longdesc">
|
27 |
-
<div id="desc_">
|
28 |
<div id="desc_wp-image-<?php the_ID(); ?>">
|
29 |
<?php the_content(); ?>
|
30 |
</div>
|
24 |
</head>
|
25 |
<body>
|
26 |
<div id="longdesc" class="template-longdesc">
|
27 |
+
<div id="desc_<?php the_ID(); ?>">
|
28 |
<div id="desc_wp-image-<?php the_ID(); ?>">
|
29 |
<?php the_content(); ?>
|
30 |
</div>
|
wp-accessibility-alt.php
CHANGED
@@ -42,6 +42,7 @@ function wpa_media_value( $column, $id ) {
|
|
42 |
$invalid_values = array(
|
43 |
'""',
|
44 |
"''",
|
|
|
45 |
);
|
46 |
switch ( $mime ) {
|
47 |
case 'image/jpeg':
|
42 |
$invalid_values = array(
|
43 |
'""',
|
44 |
"''",
|
45 |
+
' ',
|
46 |
);
|
47 |
switch ( $mime ) {
|
48 |
case 'image/jpeg':
|
wp-accessibility-longdesc.php
CHANGED
@@ -169,3 +169,15 @@ function wpa_longdesc_add_attr( $html, $id, $caption, $title, $align, $url, $siz
|
|
169 |
|
170 |
return $html;
|
171 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
return $html;
|
171 |
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Core function. Add reference style for long description.
|
175 |
+
*/
|
176 |
+
register_block_style(
|
177 |
+
'core/image',
|
178 |
+
array(
|
179 |
+
'name' => 'longdesc',
|
180 |
+
'label' => __( 'Has Long Description', 'wp-accessibility' ),
|
181 |
+
'style_handle' => 'longdesc-style',
|
182 |
+
)
|
183 |
+
);
|
wp-accessibility-settings.php
CHANGED
@@ -179,508 +179,506 @@ function wpa_admin_settings() {
|
|
179 |
<div class="wrap">
|
180 |
<h1><?php _e( 'WP Accessibility: Settings', 'wp-accessibility' ); ?></h1>
|
181 |
|
182 |
-
<div id="wpa_settings_page" class="postbox-container" style="width: 70%">
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
?>
|
192 |
-
<p>
|
193 |
-
<?php _e( 'Your <code>accessibility-ready</code> theme has skip links built in.', 'wp-accessibility' ); ?>
|
194 |
-
</p>
|
195 |
-
<?php
|
196 |
-
} else {
|
197 |
-
?>
|
198 |
-
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
199 |
-
<fieldset>
|
200 |
-
<legend><?php _e( 'Configure Skiplinks', 'wp-accessibility' ); ?></legend>
|
201 |
-
<ul>
|
202 |
-
<li>
|
203 |
-
<input type="checkbox" id="asl_enable" name="asl_enable" <?php checked( get_option( 'asl_enable' ), 'on' ); ?>/>
|
204 |
-
<label for="asl_enable"><?php _e( 'Enable Skiplinks', 'wp-accessibility' ); ?></label>
|
205 |
-
</li>
|
206 |
-
<li>
|
207 |
-
<input type="checkbox" id="asl_visible" name="asl_visible" <?php checked( get_option( 'asl_visible' ), 'on' ); ?>/>
|
208 |
-
<label for="asl_visible"><?php _e( 'Skiplinks always visible', 'wp-accessibility' ); ?></label>
|
209 |
-
</li>
|
210 |
-
<li>
|
211 |
-
<label for="asl_content"><?php _e( 'Skip to Content link target (ID of your main content container)', 'wp-accessibility' ); ?></label><br />
|
212 |
-
<input type="text" id="asl_content" name="asl_content" size="44" value="<?php echo esc_attr( get_option( 'asl_content' ) ); ?>"/>
|
213 |
-
</li>
|
214 |
-
<li>
|
215 |
-
<label for="asl_navigation"><?php _e( 'Skip to Navigation link target (ID of your main navigation container)', 'wp-accessibility' ); ?></label><br />
|
216 |
-
<input type="text" id="asl_navigation" name="asl_navigation" size="44" value="<?php echo esc_attr( get_option( 'asl_navigation' ) ); ?>"/>
|
217 |
-
</li>
|
218 |
-
<li>
|
219 |
-
<label for="asl_sitemap"><?php _e( 'Site Map link target (URL for your site map)', 'wp-accessibility' ); ?></label><br />
|
220 |
-
<input type="text" id="asl_sitemap" name="asl_sitemap" size="44" value="<?php echo esc_attr( get_option( 'asl_sitemap' ) ); ?>"/>
|
221 |
-
</li>
|
222 |
-
<li>
|
223 |
-
<label for="asl_extra_target"><?php _e( 'Add your own link (link or container ID)', 'wp-accessibility' ); ?></label><br />
|
224 |
-
<input type="text" id="asl_extra_target" name="asl_extra_target" size="44" value="<?php echo esc_attr( get_option( 'asl_extra_target' ) ); ?>"/>
|
225 |
-
</li>
|
226 |
-
<li>
|
227 |
-
<label for="asl_extra_text"><?php _e( 'Link text for your link', 'wp-accessibility' ); ?></label><br />
|
228 |
-
<input type="text" id="asl_extra_text" name="asl_extra_text" size="44" 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/>
|
232 |
-
<textarea name='asl_styles_focus' id='asl_styles_focus' cols='60' rows='4'><?php echo esc_attr( stripslashes( get_option( 'asl_styles_focus' ) ) ); ?></textarea>
|
233 |
-
</li>
|
234 |
-
<?php
|
235 |
-
if ( 'on' !== get_option( 'asl_visible' ) ) {
|
236 |
-
$disabled = " disabled='disabled' style='background: #eee;'";
|
237 |
-
$note = ' ' . __( '(Not currently visible)', 'wp-accessibility' );
|
238 |
-
} else {
|
239 |
-
$disabled = '';
|
240 |
-
$note = '';
|
241 |
-
}
|
242 |
?>
|
243 |
-
|
244 |
-
|
|
|
245 |
<?php
|
246 |
-
|
247 |
-
echo $note;
|
248 |
?>
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
<ul>
|
275 |
<li>
|
276 |
-
<input type="checkbox" id="
|
277 |
-
<label for="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
</li>
|
279 |
<li>
|
280 |
-
<
|
281 |
-
<
|
282 |
</li>
|
|
|
|
|
|
|
283 |
<li>
|
284 |
-
<
|
285 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
</li>
|
287 |
</ul>
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
|
|
|
|
|
|
300 |
<?php
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
}
|
308 |
?>
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
|
340 |
-
|
341 |
-
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
342 |
-
<ul>
|
343 |
<?php
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
<li>
|
351 |
-
<input type="checkbox" id="wpa_more" name="wpa_more" <?php checked( get_option( 'wpa_more' ), 'on' ); ?>/>
|
352 |
-
<label for="wpa_more"><?php _e( 'Add post title to "more" links.', 'wp-accessibility' ); ?></label>
|
353 |
-
<label for="wpa_continue"><?php _e( 'Continue reading text', 'wp-accessibility' ); ?></label>
|
354 |
-
<input type="text" id="wpa_continue" name="wpa_continue" value="<?php echo esc_attr( get_option( 'wpa_continue' ) ); ?>"/>
|
355 |
-
</li>
|
356 |
-
<li>
|
357 |
-
<input type="checkbox" id="wpa_insert_roles" name="wpa_insert_roles" <?php checked( get_option( 'wpa_insert_roles' ), 'on' ); ?>/>
|
358 |
-
<label for="wpa_insert_roles"><?php _e( 'Add landmark roles to HTML5 structural elements', 'wp-accessibility' ); ?></label><br/>
|
359 |
-
<label for="wpa_complementary_container"><?php _e( 'ID for complementary role', 'wp-accessibility' ); ?></label>
|
360 |
-
<input type="text" id="wpa_complementary_container" name="wpa_complementary_container" value="#<?php echo esc_attr( get_option( 'wpa_complementary_container' ) ); ?>"/>
|
361 |
-
</li>
|
362 |
-
<li>
|
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 |
-
|
370 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
}
|
372 |
?>
|
373 |
-
<
|
374 |
-
<
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
<
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
<
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
<p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Update Miscellaneous Settings', 'wp-accessibility' ); ?>"/></p>
|
425 |
-
</form>
|
426 |
-
</div>
|
427 |
-
</div>
|
428 |
-
<div class="postbox">
|
429 |
-
<h2 class='hndle'><?php _e( 'Remove Title Attributes', 'wp-accessibility' ); ?></h2>
|
430 |
-
|
431 |
-
<div class="inside">
|
432 |
-
<?php wpa_accessible_theme(); ?>
|
433 |
-
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
434 |
-
<fieldset>
|
435 |
-
<legend><?php _e( 'Remove title attributes from:', 'wp-accessibility' ); ?></legend>
|
436 |
-
<ul>
|
437 |
-
<li><input type="checkbox" id="rta_from_tag_clouds" name="rta_from_tag_clouds" <?php checked( get_option( 'rta_from_tag_clouds' ), 'on' ); ?>/>
|
438 |
-
<label for="rta_from_tag_clouds"><?php _e( 'Tag clouds', 'wp-accessibility' ); ?></label>
|
439 |
-
</li>
|
440 |
-
</ul>
|
441 |
-
</fieldset>
|
442 |
-
<p>
|
443 |
-
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'wpa-nonce' ); ?>"/>
|
444 |
-
<input type="hidden" name="action" value="rta"/>
|
445 |
-
</p>
|
446 |
-
|
447 |
-
<p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Update Title Attribute Settings', 'wp-accessibility' ); ?>"/></p>
|
448 |
-
</form>
|
449 |
-
</div>
|
450 |
-
</div>
|
451 |
-
<div class="postbox">
|
452 |
-
<h2 class='hndle'><?php _e( 'Color Contrast Tester', 'wp-accessibility' ); ?></h2>
|
453 |
-
|
454 |
-
<div class="inside">
|
455 |
-
<?php
|
456 |
-
$colors = wpa_contrast();
|
457 |
-
if ( $colors ) {
|
458 |
-
$l_contrast = wpa_luminosity( $colors['red1'], $colors['red2'], $colors['green1'], $colors['green2'], $colors['blue1'], $colors['blue2'] ) . ':1';
|
459 |
-
$luminance_raw = wpa_luminosity( $colors['red1'], $colors['red2'], $colors['green1'], $colors['green2'], $colors['blue1'], $colors['blue2'] );
|
460 |
-
$hex1 = esc_attr( $colors['hex1'] );
|
461 |
-
$hex2 = esc_attr( $colors['hex2'] );
|
462 |
-
} else {
|
463 |
-
$hex1 = '';
|
464 |
-
$hex2 = '';
|
465 |
-
$l_contrast = false;
|
466 |
-
}
|
467 |
-
if ( $l_contrast ) {
|
468 |
-
$results = "<div class='updated notice'>";
|
469 |
-
// Translators: Contrast ratio, foreground Hex color, background Hex color.
|
470 |
-
$results .= '<p class="stats wcag2">' . sprintf( __( 'Luminosity Contrast Ratio for %2$s and %3$s is %1$s (Threshold: greater than 7:1 for AAA, 4.5:1 for AA)', 'wp-accessibility' ), '<strong>' . $l_contrast . '</strong>', '<code>#' . $hex1 . '</code>', '<code>#' . $hex2 . '</code>' ) . '</p><p>';
|
471 |
-
if ( $luminance_raw >= 7 ) {
|
472 |
-
$results .= __( 'The colors compared <strong>pass</strong> the relative luminosity test at level AAA.', 'wp-accessibility' );
|
473 |
-
}
|
474 |
-
if ( $luminance_raw >= 4.5 && $luminance_raw < 7 ) {
|
475 |
-
$results .= __( 'The colors compared <strong>pass</strong> the relative luminosity test at level AA.', 'wp-accessibility' );
|
476 |
-
}
|
477 |
-
if ( $luminance_raw >= 3 && $luminance_raw < 4.5 ) {
|
478 |
-
$results .= __( 'The colors compared pass the relative luminosity test <strong>only when used in large print</strong> situations (greater than 18pt text or 14pt bold text.)', 'wp-accessibility' );
|
479 |
-
}
|
480 |
-
if ( $luminance_raw < 3 ) {
|
481 |
-
$results .= __( 'The colors compared <strong>do not pass</strong> the relative luminosity test.', 'wp-accessibility' );
|
482 |
-
}
|
483 |
-
$results .= " <a href='#contrast'>" . __( 'Test another set of colors', 'wp-accessibility' ) . '</a>';
|
484 |
-
$results .= '</p>';
|
485 |
-
$results .= "
|
486 |
-
<div class=\"views\">
|
487 |
-
<p class='large' style=\"font-size: 2em; line-height: 1.4;color: #$hex1;background: #$hex2;border: 3px solid #$hex1\">Large Print Example</p>
|
488 |
-
<p class='small' style=\"font-size: .9em;color: #$hex1;background: #$hex2;border: 3px solid #$hex1\">Small Print Example</p>
|
489 |
-
<p class='large' style=\"font-size: 2em; line-height: 1.4;color: #$hex2;background: #$hex1;border: 3px solid #$hex2\">Large Print Example (Inverted)</p>
|
490 |
-
<p class='small' style=\"font-size: .9em;color: #$hex2;background: #$hex1;border: 3px solid #$hex2\">Small Print Example (Inverted)</p>
|
491 |
-
</div>
|
492 |
-
</div>";
|
493 |
-
echo $results;
|
494 |
-
}
|
495 |
-
?>
|
496 |
-
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
497 |
-
<fieldset>
|
498 |
-
<legend><?php _e( 'Test of relative luminosity', 'wp-accessibility' ); ?></legend>
|
499 |
-
<ul>
|
500 |
-
<li class='fore'>
|
501 |
-
<div id="fore"></div>
|
502 |
-
<label for="color1"><?php _e( 'Foreground color', 'wp-accessibility' ); ?></label><br/>
|
503 |
-
<input type="text" name="color" value="#<?php echo esc_attr( $hex1 ); ?>" size="34" id="color1"/>
|
504 |
-
</li>
|
505 |
-
<li class='back'>
|
506 |
-
<div id="back"></div>
|
507 |
-
<label for="color2"><?php _e( 'Background color', 'wp-accessibility' ); ?></label><br/>
|
508 |
-
<input type="text" name="color2" value="#<?php echo esc_attr( $hex2 ); ?>" size="34" id="color2"/>
|
509 |
-
</li>
|
510 |
-
</ul>
|
511 |
-
</fieldset>
|
512 |
-
<p>
|
513 |
-
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'wpa-nonce' ); ?>"/>
|
514 |
-
<input type="hidden" name="action" value="contrast"/>
|
515 |
-
</p>
|
516 |
-
|
517 |
-
<p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Check Color Contrast', 'wp-accessibility' ); ?>"/></p>
|
518 |
-
</form>
|
519 |
-
</div>
|
520 |
-
</div>
|
521 |
-
<div class="postbox" id="privacy">
|
522 |
-
<h2 class='hndle'><?php _e( 'Privacy', 'wp-accessibility' ); ?></h2>
|
523 |
-
|
524 |
-
<div class="inside">
|
525 |
-
<h3><?php _e( 'Cookies', 'wp-accessibility' ); ?></h3>
|
526 |
-
<p><?php _e( 'The accessibility toolbar sets cookies to maintain awareness of the user\'s selected accessibility options. If the toolbar is not in use, WP Accessibility does not set any cookies.', 'wp-accessibility' ); ?></p>
|
527 |
-
<h3><?php _e( 'Information Collected by WP Accessibility', 'wp-accessibility' ); ?></h3>
|
528 |
-
<p><?php _e( 'WP Accessibility does not collect any private information about users or visitors.', 'wp-accessibility' ); ?></p>
|
529 |
-
</div>
|
530 |
-
</div>
|
531 |
-
<div class="postbox" id="get-support">
|
532 |
-
<h2 class='hndle'><?php _e( 'Get Plug-in Support', 'wp-accessibility' ); ?></h2>
|
533 |
-
|
534 |
-
<div class="inside">
|
535 |
-
<div class='wpa-support-me'>
|
536 |
-
<p>
|
537 |
-
<?php
|
538 |
-
// Translators: URL to donate.
|
539 |
-
printf( __( 'Please, consider <a href="%s">making a donation</a> to support WP Accessibility!', 'wp-accessibility' ), 'https://www.joedolson.com/donate/' );
|
540 |
-
?>
|
541 |
-
</p>
|
542 |
-
</div>
|
543 |
-
<?php wpa_get_support_form(); ?>
|
544 |
</div>
|
545 |
</div>
|
546 |
</div>
|
547 |
-
</div>
|
548 |
-
</div>
|
549 |
-
|
550 |
-
<div class="postbox-container" style="width:20%">
|
551 |
-
<div class="metabox-holder">
|
552 |
-
<div class="ui-sortable meta-box-sortables">
|
553 |
-
<div class="postbox">
|
554 |
-
<h2 class='hndle'><?php _e( 'Support this Plugin', 'wp-accessibility' ); ?></h2>
|
555 |
-
|
556 |
-
<div class="inside">
|
557 |
-
<p>
|
558 |
-
<a href="https://twitter.com/intent/follow?screen_name=joedolson" class="twitter-follow-button" data-size="small" data-related="joedolson">Follow @joedolson</a>
|
559 |
-
<script>!function (d, s, id) {
|
560 |
-
var js, fjs = d.getElementsByTagName(s)[0];
|
561 |
-
if (!d.getElementById(id)) {
|
562 |
-
js = d.createElement(s);
|
563 |
-
js.id = id;
|
564 |
-
js.src = "https://platform.twitter.com/widgets.js";
|
565 |
-
fjs.parentNode.insertBefore(js, fjs);
|
566 |
-
}
|
567 |
-
}(document, "script", "twitter-wjs");</script>
|
568 |
-
</p>
|
569 |
-
<p><?php _e( "If you've found WP Accessibility useful, then please consider <a href='http://wordpress.org/extend/plugins/wp-accessibility/'>rating it five stars</a>, <a href='http://www.joedolson.com/donate/'>making a donation</a>, or <a href='https://translate.wordpress.org/projects/wp-plugins/wp-accessibility'>helping with translation</a>.", 'wp-accessibility' ); ?></p>
|
570 |
|
571 |
-
|
572 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
573 |
|
574 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
575 |
<div>
|
576 |
-
<
|
577 |
-
|
578 |
-
<
|
579 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
</div>
|
581 |
-
</
|
582 |
</div>
|
583 |
</div>
|
584 |
-
</div>
|
585 |
-
</div>
|
586 |
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
|
|
|
|
598 |
</div>
|
599 |
-
</div>
|
600 |
-
</div>
|
601 |
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
|
|
|
|
616 |
</div>
|
617 |
-
</div>
|
618 |
-
</div>
|
619 |
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
|
|
|
|
640 |
</div>
|
641 |
-
</div>
|
642 |
-
</div>
|
643 |
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
|
|
|
|
659 |
</div>
|
660 |
-
|
661 |
-
</div>
|
662 |
-
<?php } ?>
|
663 |
|
664 |
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
|
|
677 |
</div>
|
678 |
-
</div>
|
679 |
-
</div>
|
680 |
|
681 |
|
682 |
-
|
683 |
-
</div>
|
684 |
|
685 |
</div>
|
686 |
<?php
|
179 |
<div class="wrap">
|
180 |
<h1><?php _e( 'WP Accessibility: Settings', 'wp-accessibility' ); ?></h1>
|
181 |
|
182 |
+
<div id="wpa_settings_page" class="postbox-container" style="width: 70%">
|
183 |
+
<div class="metabox-holder">
|
184 |
+
<div class="ui-sortable meta-box-sortables">
|
185 |
+
<div class="postbox">
|
186 |
+
<h2 class='hndle'><?php _e( 'Add Skiplinks', 'wp-accessibility' ); ?></h2>
|
187 |
+
|
188 |
+
<div class="inside">
|
189 |
+
<?php
|
190 |
+
if ( wpa_accessible_theme() && 'on' !== get_option( 'asl_enable' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
?>
|
192 |
+
<p>
|
193 |
+
<?php _e( 'Your <code>accessibility-ready</code> theme has skip links built in.', 'wp-accessibility' ); ?>
|
194 |
+
</p>
|
195 |
<?php
|
196 |
+
} else {
|
|
|
197 |
?>
|
198 |
+
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
199 |
+
<fieldset>
|
200 |
+
<legend><?php _e( 'Configure Skiplinks', 'wp-accessibility' ); ?></legend>
|
201 |
+
<ul>
|
202 |
+
<li>
|
203 |
+
<input type="checkbox" id="asl_enable" name="asl_enable" <?php checked( get_option( 'asl_enable' ), 'on' ); ?>/>
|
204 |
+
<label for="asl_enable"><?php _e( 'Enable Skiplinks', 'wp-accessibility' ); ?></label>
|
205 |
+
</li>
|
206 |
+
<li>
|
207 |
+
<input type="checkbox" id="asl_visible" name="asl_visible" <?php checked( get_option( 'asl_visible' ), 'on' ); ?>/>
|
208 |
+
<label for="asl_visible"><?php _e( 'Skiplinks always visible', 'wp-accessibility' ); ?></label>
|
209 |
+
</li>
|
210 |
+
<li>
|
211 |
+
<label for="asl_content"><?php _e( 'Skip to Content link target (ID of your main content container)', 'wp-accessibility' ); ?></label><br />
|
212 |
+
<input type="text" id="asl_content" name="asl_content" size="44" value="<?php echo esc_attr( get_option( 'asl_content' ) ); ?>"/>
|
213 |
+
</li>
|
214 |
+
<li>
|
215 |
+
<label for="asl_navigation"><?php _e( 'Skip to Navigation link target (ID of your main navigation container)', 'wp-accessibility' ); ?></label><br />
|
216 |
+
<input type="text" id="asl_navigation" name="asl_navigation" size="44" value="<?php echo esc_attr( get_option( 'asl_navigation' ) ); ?>"/>
|
217 |
+
</li>
|
218 |
+
<li>
|
219 |
+
<label for="asl_sitemap"><?php _e( 'Site Map link target (URL for your site map)', 'wp-accessibility' ); ?></label><br />
|
220 |
+
<input type="text" id="asl_sitemap" name="asl_sitemap" size="44" value="<?php echo esc_attr( get_option( 'asl_sitemap' ) ); ?>"/>
|
221 |
+
</li>
|
222 |
+
<li>
|
223 |
+
<label for="asl_extra_target"><?php _e( 'Add your own link (link or container ID)', 'wp-accessibility' ); ?></label><br />
|
224 |
+
<input type="text" id="asl_extra_target" name="asl_extra_target" size="44" value="<?php echo esc_attr( get_option( 'asl_extra_target' ) ); ?>"/>
|
225 |
+
</li>
|
226 |
+
<li>
|
227 |
+
<label for="asl_extra_text"><?php _e( 'Link text for your link', 'wp-accessibility' ); ?></label><br />
|
228 |
+
<input type="text" id="asl_extra_text" name="asl_extra_text" size="44" 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/>
|
232 |
+
<textarea name='asl_styles_focus' id='asl_styles_focus' cols='60' rows='4'><?php echo esc_attr( stripslashes( get_option( 'asl_styles_focus' ) ) ); ?></textarea>
|
233 |
+
</li>
|
234 |
+
<?php
|
235 |
+
if ( 'on' !== get_option( 'asl_visible' ) ) {
|
236 |
+
$disabled = " disabled='disabled' style='background: #eee;'";
|
237 |
+
$note = ' ' . __( '(Not currently visible)', 'wp-accessibility' );
|
238 |
+
} else {
|
239 |
+
$disabled = '';
|
240 |
+
$note = '';
|
241 |
+
}
|
242 |
+
?>
|
243 |
+
<li>
|
244 |
+
<label for="asl_styles_passive">
|
245 |
+
<?php
|
246 |
+
_e( 'Styles for Skiplinks without focus', 'wp-accessibility' );
|
247 |
+
echo $note;
|
248 |
+
?>
|
249 |
+
</label><br/>
|
250 |
+
<textarea name='asl_styles_passive' id='asl_styles_passive' cols='60' rows='4'<?php echo $disabled; ?>><?php echo stripslashes( get_option( 'asl_styles_passive' ) ); ?></textarea>
|
251 |
+
</li>
|
252 |
+
</ul>
|
253 |
+
</fieldset>
|
254 |
+
<p>
|
255 |
+
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'wpa-nonce' ); ?>"/>
|
256 |
+
<input type="hidden" name="action" value="asl"/>
|
257 |
+
</p>
|
258 |
+
<p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Update Skiplink Settings', 'wp-accessibility' ); ?>"/></p>
|
259 |
+
</form>
|
260 |
+
<?php
|
261 |
+
}
|
262 |
+
?>
|
263 |
+
</div>
|
264 |
+
</div>
|
265 |
+
<div class="postbox">
|
266 |
+
<h2 id="toolbar" class='hndle'><?php _e( 'Accessibility Toolbar Settings', 'wp-accessibility' ); ?></h2>
|
267 |
+
<div class="inside">
|
268 |
+
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
269 |
<ul>
|
270 |
<li>
|
271 |
+
<input type="checkbox" id="wpa_toolbar" name="wpa_toolbar" <?php checked( get_option( 'wpa_toolbar' ), 'on' ); ?>/>
|
272 |
+
<label for="wpa_toolbar"><?php _e( 'Add Accessibility toolbar with fontsize adjustment and contrast toggle', 'wp-accessibility' ); ?></label>
|
273 |
+
<ul>
|
274 |
+
<li>
|
275 |
+
<input type="checkbox" id="wpa_toolbar_fs" name="wpa_toolbar_fs" <?php checked( get_option( 'wpa_toolbar_fs' ), 'off' ); ?>/>
|
276 |
+
<label for="wpa_toolbar_fs"><?php _e( 'Exclude font size toggle from Accessibility toolbar', 'wp-accessibility' ); ?></label>
|
277 |
+
</li>
|
278 |
+
<li>
|
279 |
+
<input type="checkbox" id="wpa_toolbar_ct" name="wpa_toolbar_ct" <?php checked( get_option( 'wpa_toolbar_ct' ), 'off' ); ?>/>
|
280 |
+
<label for="wpa_toolbar_ct"><?php _e( 'Exclude contrast toggle from Accessibility toolbar', 'wp-accessibility' ); ?></label>
|
281 |
+
</li>
|
282 |
+
<li>
|
283 |
+
<input type="checkbox" aria-describedby="wpa_toolbar_gs_note" id="wpa_toolbar_gs" name="wpa_toolbar_gs" <?php checked( get_option( 'wpa_toolbar_gs' ), 'on' ); ?> />
|
284 |
+
<label for="wpa_toolbar_gs"><?php _e( 'Include grayscale toggle with Accessibility toolbar', 'wp-accessibility' ); ?></label><br /><em id="wpa_toolbar_gs_note"><?php _e( 'The grayscale toggle is only intended for testing, and will appear only for logged-in administrators', 'wp-accessibility' ); ?></em>
|
285 |
+
</li>
|
286 |
+
</ul>
|
287 |
</li>
|
288 |
<li>
|
289 |
+
<label for="wpa_toolbar_default"><?php _e( 'Toolbar location (ID attribute, such as <code>#header</code>)', 'wp-accessibility' ); ?></label>
|
290 |
+
<input type="text" id="wpa_toolbar_default" name="wpa_toolbar_default" value="<?php echo esc_attr( get_option( 'wpa_toolbar_default' ) ); ?>" />
|
291 |
</li>
|
292 |
+
<?php
|
293 |
+
$size = absint( get_option( 'wpa_toolbar_size' ) );
|
294 |
+
?>
|
295 |
<li>
|
296 |
+
<label for="wpa_toolbar_size"><?php _e( 'Toolbar font size', 'wp-accessibility' ); ?></label>
|
297 |
+
<select name='wpa_toolbar_size' id='wpa_toolbar_size'>
|
298 |
+
<option value=''><?php _e( 'Default size', 'wp-accessibility' ); ?></option>
|
299 |
+
<?php
|
300 |
+
for ( $i = 1.2; $i <= 3.8; ) {
|
301 |
+
$val = ( $i * 10 ) + 2;
|
302 |
+
$current = absint( $val );
|
303 |
+
$selected_size = ( $current === $size ) ? ' selected="selected"' : '';
|
304 |
+
echo "<option value='$val'$selected_size>$val px</option>";
|
305 |
+
$i = $i + .1;
|
306 |
+
}
|
307 |
+
?>
|
308 |
+
</select>
|
309 |
+
</li>
|
310 |
+
<li>
|
311 |
+
<input type="checkbox" id="wpa_alternate_fontsize" name="wpa_alternate_fontsize" <?php checked( get_option( 'wpa_alternate_fontsize' ), 'on' ); ?>/>
|
312 |
+
<label for="wpa_alternate_fontsize"><?php _e( 'Use alternate font resizing stylesheet', 'wp-accessibility' ); ?></label>
|
313 |
+
</li>
|
314 |
+
<li>
|
315 |
+
<input type="checkbox" id="wpa_widget_toolbar" name="wpa_widget_toolbar" <?php checked( get_option( 'wpa_widget_toolbar' ), 'on' ); ?>/>
|
316 |
+
<label for="wpa_widget_toolbar"><?php _e( 'Support Accessibility toolbar as shortcode or widget', 'wp-accessibility' ); ?></label>
|
317 |
+
</li>
|
318 |
+
<li>
|
319 |
+
<input type="checkbox" id="wpa_toolbar_right" name="wpa_toolbar_right" <?php checked( get_option( 'wpa_toolbar_right' ), 'on' ); ?>/>
|
320 |
+
<label for="wpa_toolbar_right"><?php _e( 'Place toolbar on right side of screen.', 'wp-accessibility' ); ?></label>
|
321 |
+
</li>
|
322 |
+
<li>
|
323 |
+
<input type="checkbox" id="wpa_toolbar_mobile" name="wpa_toolbar_mobile" <?php checked( get_option( 'wpa_toolbar_mobile' ), 'on' ); ?>/>
|
324 |
+
<label for="wpa_toolbar_mobile"><?php _e( 'Hide toolbar on small screens.', 'wp-accessibility' ); ?></label>
|
325 |
</li>
|
326 |
</ul>
|
327 |
+
<p>
|
328 |
+
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'wpa-nonce' ); ?>"/>
|
329 |
+
<input type="hidden" name="action" value="toolbar" />
|
330 |
+
</p>
|
331 |
+
|
332 |
+
<p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Update Toolbar Settings', 'wp-accessibility' ); ?>"/></p>
|
333 |
+
</form>
|
334 |
+
</div>
|
335 |
+
</div>
|
336 |
+
<div class="postbox">
|
337 |
+
<h2 id="contrast" class='hndle'><?php _e( 'Miscellaneous Accessibility Settings', 'wp-accessibility' ); ?></h2>
|
338 |
+
|
339 |
+
<div class="inside">
|
340 |
+
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
341 |
+
<ul>
|
342 |
<?php
|
343 |
+
if ( ! wpa_accessible_theme() ) {
|
344 |
+
?>
|
345 |
+
<li>
|
346 |
+
<input type="checkbox" id="wpa_lang" name="wpa_lang" <?php checked( get_option( 'wpa_lang' ), 'on' ); ?>/>
|
347 |
+
<label for="wpa_lang"><?php _e( 'Add Site Language and text direction to HTML element', 'wp-accessibility' ); ?></label>
|
348 |
+
</li>
|
349 |
+
<li>
|
350 |
+
<input type="checkbox" id="wpa_more" name="wpa_more" <?php checked( get_option( 'wpa_more' ), 'on' ); ?>/>
|
351 |
+
<label for="wpa_more"><?php _e( 'Add post title to "more" links.', 'wp-accessibility' ); ?></label>
|
352 |
+
<label for="wpa_continue"><?php _e( 'Continue reading text', 'wp-accessibility' ); ?></label>
|
353 |
+
<input type="text" id="wpa_continue" name="wpa_continue" value="<?php echo esc_attr( get_option( 'wpa_continue' ) ); ?>"/>
|
354 |
+
</li>
|
355 |
+
<li>
|
356 |
+
<input type="checkbox" id="wpa_insert_roles" name="wpa_insert_roles" <?php checked( get_option( 'wpa_insert_roles' ), 'on' ); ?>/>
|
357 |
+
<label for="wpa_insert_roles"><?php _e( 'Add landmark roles to HTML5 structural elements', 'wp-accessibility' ); ?></label><br/>
|
358 |
+
<label for="wpa_complementary_container"><?php _e( 'ID for complementary role', 'wp-accessibility' ); ?></label>
|
359 |
+
<input type="text" id="wpa_complementary_container" name="wpa_complementary_container" value="#<?php echo esc_attr( get_option( 'wpa_complementary_container' ) ); ?>"/>
|
360 |
+
</li>
|
361 |
+
<li>
|
362 |
+
<input type="checkbox" id="wpa_labels" name="wpa_labels" <?php checked( get_option( 'wpa_labels' ), 'on' ); ?> />
|
363 |
+
<label for='wpa_labels'><?php _e( 'Automatically Label WordPress search form and comment forms', 'wp-accessibility' ); ?></label>
|
364 |
+
</li>
|
365 |
+
<?php
|
366 |
+
} else {
|
367 |
+
?>
|
368 |
+
<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>
|
369 |
+
<?php
|
370 |
}
|
371 |
?>
|
372 |
+
<li>
|
373 |
+
<input type="checkbox" id="wpa_target" name="wpa_target" <?php checked( get_option( 'wpa_target' ), 'on' ); ?>/>
|
374 |
+
<label for="wpa_target"><?php _e( 'Remove target attribute from links', 'wp-accessibility' ); ?></label>
|
375 |
+
</li>
|
376 |
+
<li>
|
377 |
+
<input type="checkbox" id="wpa_search" name="wpa_search" <?php checked( get_option( 'wpa_search' ), 'on' ); ?>/>
|
378 |
+
<label for="wpa_search"><?php _e( 'Force search error on empty search submission (theme must have search.php template)', 'wp-accessibility' ); ?></label>
|
379 |
+
</li>
|
380 |
+
<li>
|
381 |
+
<input type="checkbox" id="wpa_tabindex" name="wpa_tabindex" <?php checked( get_option( 'wpa_tabindex' ), 'on' ); ?>/>
|
382 |
+
<label for="wpa_tabindex"><?php _e( 'Remove tabindex from focusable elements', 'wp-accessibility' ); ?></label>
|
383 |
+
</li>
|
384 |
+
<li>
|
385 |
+
<input type="checkbox" id="wpa_underline" name="wpa_underline" <?php checked( get_option( 'wpa_underline' ), 'on' ); ?>/>
|
386 |
+
<label for="wpa_underline"><?php _e( 'Force underline on all links', 'wp-accessibility' ); ?></label>
|
387 |
+
</li>
|
388 |
+
<li>
|
389 |
+
<label for="wpa_longdesc"><?php _e( 'Long Description UI', 'wp-accessibility' ); ?></label>
|
390 |
+
<select id="wpa_longdesc" name="wpa_longdesc">
|
391 |
+
<option value='false'<?php selected( get_option( 'wpa_longdesc' ), 'false' ); ?>><?php _e( 'Browser defaults only', 'wp-accessibility' ); ?></option>
|
392 |
+
<option value='link'<?php selected( get_option( 'wpa_longdesc' ), 'link' ); ?>><?php _e( 'Link to description', 'wp-accessibility' ); ?></option>
|
393 |
+
<option value='jquery'<?php selected( get_option( 'wpa_longdesc' ), 'jquery' ); ?>><?php _e( 'Button trigger to overlay image', 'wp-accessibility' ); ?></option>
|
394 |
+
</select>
|
395 |
+
</li>
|
396 |
+
<li>
|
397 |
+
<input type="checkbox" id="wpa_longdesc_featured" name="wpa_longdesc_featured" <?php checked( get_option( 'wpa_longdesc_featured' ), 'on' ); ?>/>
|
398 |
+
<label for="wpa_longdesc_featured"><?php _e( 'Support <code>longdesc</code> on featured images', 'wp-accessibility' ); ?></label>
|
399 |
+
</li>
|
400 |
+
<li>
|
401 |
+
<input type="checkbox" id="wpa_row_actions" name="wpa_row_actions" <?php checked( get_option( 'wpa_row_actions' ), 'on' ); ?>/>
|
402 |
+
<label for="wpa_row_actions"><?php _e( 'Make admin row actions always visible', 'wp-accessibility' ); ?></label>
|
403 |
+
</li>
|
404 |
+
<li>
|
405 |
+
<input type="checkbox" id="wpa_image_titles" name="wpa_image_titles" <?php checked( get_option( 'wpa_image_titles' ), 'on' ); ?>/>
|
406 |
+
<label for="wpa_image_titles"><?php _e( 'Remove title attributes inserted into post content and featured images.', 'wp-accessibility' ); ?></label>
|
407 |
+
</li>
|
408 |
+
<li>
|
409 |
+
<input type="checkbox" id="wpa_diagnostics" name="wpa_diagnostics" <?php checked( get_option( 'wpa_diagnostics' ), 'on' ); ?>/>
|
410 |
+
<label for="wpa_diagnostics"><?php _e( 'Enable diagnostic CSS', 'wp-accessibility' ); ?></label>
|
411 |
+
</li>
|
412 |
+
<li>
|
413 |
+
<input type="checkbox" id="wpa_focus" name="wpa_focus" <?php checked( get_option( 'wpa_focus' ), 'on' ); ?>/>
|
414 |
+
<label for="wpa_focus"><?php _e( 'Add outline to elements on keyboard focus', 'wp-accessibility' ); ?></label>
|
415 |
+
<label for="wpa_focus_color"><?php _e( 'Outline color (hexadecimal, optional)', 'wp-accessibility' ); ?></label>
|
416 |
+
<input type="text" id="wpa_focus_color" name="wpa_focus_color" value="#<?php echo esc_attr( get_option( 'wpa_focus_color' ) ); ?>"/></li>
|
417 |
+
</ul>
|
418 |
+
<p>
|
419 |
+
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'wpa-nonce' ); ?>"/>
|
420 |
+
<input type="hidden" name="action" value="misc"/>
|
421 |
+
</p>
|
422 |
+
|
423 |
+
<p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Update Miscellaneous Settings', 'wp-accessibility' ); ?>"/></p>
|
424 |
+
</form>
|
425 |
+
</div>
|
426 |
+
</div>
|
427 |
+
<div class="postbox">
|
428 |
+
<h2 class='hndle'><?php _e( 'Remove Title Attributes', 'wp-accessibility' ); ?></h2>
|
429 |
+
|
430 |
+
<div class="inside">
|
431 |
+
<?php wpa_accessible_theme(); ?>
|
432 |
+
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
433 |
+
<fieldset>
|
434 |
+
<legend><?php _e( 'Remove title attributes from:', 'wp-accessibility' ); ?></legend>
|
435 |
+
<ul>
|
436 |
+
<li><input type="checkbox" id="rta_from_tag_clouds" name="rta_from_tag_clouds" <?php checked( get_option( 'rta_from_tag_clouds' ), 'on' ); ?>/>
|
437 |
+
<label for="rta_from_tag_clouds"><?php _e( 'Tag clouds', 'wp-accessibility' ); ?></label>
|
438 |
+
</li>
|
439 |
+
</ul>
|
440 |
+
</fieldset>
|
441 |
+
<p>
|
442 |
+
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'wpa-nonce' ); ?>"/>
|
443 |
+
<input type="hidden" name="action" value="rta"/>
|
444 |
+
</p>
|
445 |
+
|
446 |
+
<p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Update Title Attribute Settings', 'wp-accessibility' ); ?>"/></p>
|
447 |
+
</form>
|
448 |
+
</div>
|
449 |
+
</div>
|
450 |
+
<div class="postbox">
|
451 |
+
<h2 class='hndle'><?php _e( 'Color Contrast Tester', 'wp-accessibility' ); ?></h2>
|
452 |
|
453 |
+
<div class="inside">
|
|
|
|
|
454 |
<?php
|
455 |
+
$colors = wpa_contrast();
|
456 |
+
if ( $colors ) {
|
457 |
+
$l_contrast = wpa_luminosity( $colors['red1'], $colors['red2'], $colors['green1'], $colors['green2'], $colors['blue1'], $colors['blue2'] ) . ':1';
|
458 |
+
$luminance_raw = wpa_luminosity( $colors['red1'], $colors['red2'], $colors['green1'], $colors['green2'], $colors['blue1'], $colors['blue2'] );
|
459 |
+
$hex1 = esc_attr( $colors['hex1'] );
|
460 |
+
$hex2 = esc_attr( $colors['hex2'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
} else {
|
462 |
+
$hex1 = '';
|
463 |
+
$hex2 = '';
|
464 |
+
$l_contrast = false;
|
465 |
+
}
|
466 |
+
if ( $l_contrast ) {
|
467 |
+
$results = "<div class='updated notice'>";
|
468 |
+
// Translators: Contrast ratio, foreground Hex color, background Hex color.
|
469 |
+
$results .= '<p class="stats wcag2">' . sprintf( __( 'Luminosity Contrast Ratio for %2$s and %3$s is %1$s (Threshold: greater than 7:1 for AAA, 4.5:1 for AA)', 'wp-accessibility' ), '<strong>' . $l_contrast . '</strong>', '<code>#' . $hex1 . '</code>', '<code>#' . $hex2 . '</code>' ) . '</p><p>';
|
470 |
+
if ( $luminance_raw >= 7 ) {
|
471 |
+
$results .= __( 'The colors compared <strong>pass</strong> the relative luminosity test at level AAA.', 'wp-accessibility' );
|
472 |
+
}
|
473 |
+
if ( $luminance_raw >= 4.5 && $luminance_raw < 7 ) {
|
474 |
+
$results .= __( 'The colors compared <strong>pass</strong> the relative luminosity test at level AA.', 'wp-accessibility' );
|
475 |
+
}
|
476 |
+
if ( $luminance_raw >= 3 && $luminance_raw < 4.5 ) {
|
477 |
+
$results .= __( 'The colors compared pass the relative luminosity test <strong>only when used in large print</strong> situations (greater than 18pt text or 14pt bold text.)', 'wp-accessibility' );
|
478 |
+
}
|
479 |
+
if ( $luminance_raw < 3 ) {
|
480 |
+
$results .= __( 'The colors compared <strong>do not pass</strong> the relative luminosity test.', 'wp-accessibility' );
|
481 |
+
}
|
482 |
+
$results .= " <a href='#contrast'>" . __( 'Test another set of colors', 'wp-accessibility' ) . '</a>';
|
483 |
+
$results .= '</p>';
|
484 |
+
$results .= "
|
485 |
+
<div class=\"views\">
|
486 |
+
<p class='large' style=\"font-size: 2em; line-height: 1.4;color: #$hex1;background: #$hex2;border: 3px solid #$hex1\">Large Print Example</p>
|
487 |
+
<p class='small' style=\"font-size: .9em;color: #$hex1;background: #$hex2;border: 3px solid #$hex1\">Small Print Example</p>
|
488 |
+
<p class='large' style=\"font-size: 2em; line-height: 1.4;color: #$hex2;background: #$hex1;border: 3px solid #$hex2\">Large Print Example (Inverted)</p>
|
489 |
+
<p class='small' style=\"font-size: .9em;color: #$hex2;background: #$hex1;border: 3px solid #$hex2\">Small Print Example (Inverted)</p>
|
490 |
+
</div>
|
491 |
+
</div>";
|
492 |
+
echo $results;
|
493 |
}
|
494 |
?>
|
495 |
+
<form method="post" action="<?php echo admin_url( 'options-general.php?page=wp-accessibility/wp-accessibility.php' ); ?>">
|
496 |
+
<fieldset>
|
497 |
+
<legend><?php _e( 'Test of relative luminosity', 'wp-accessibility' ); ?></legend>
|
498 |
+
<ul>
|
499 |
+
<li class='fore'>
|
500 |
+
<div id="fore"></div>
|
501 |
+
<label for="color1"><?php _e( 'Foreground color', 'wp-accessibility' ); ?></label><br/>
|
502 |
+
<input type="text" name="color" value="#<?php echo esc_attr( $hex1 ); ?>" size="34" id="color1"/>
|
503 |
+
</li>
|
504 |
+
<li class='back'>
|
505 |
+
<div id="back"></div>
|
506 |
+
<label for="color2"><?php _e( 'Background color', 'wp-accessibility' ); ?></label><br/>
|
507 |
+
<input type="text" name="color2" value="#<?php echo esc_attr( $hex2 ); ?>" size="34" id="color2"/>
|
508 |
+
</li>
|
509 |
+
</ul>
|
510 |
+
</fieldset>
|
511 |
+
<p>
|
512 |
+
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'wpa-nonce' ); ?>"/>
|
513 |
+
<input type="hidden" name="action" value="contrast"/>
|
514 |
+
</p>
|
515 |
+
|
516 |
+
<p><input type="submit" name="wpa-settings" class="button-primary" value="<?php _e( 'Check Color Contrast', 'wp-accessibility' ); ?>"/></p>
|
517 |
+
</form>
|
518 |
+
</div>
|
519 |
+
</div>
|
520 |
+
<div class="postbox" id="privacy">
|
521 |
+
<h2 class='hndle'><?php _e( 'Privacy', 'wp-accessibility' ); ?></h2>
|
522 |
+
|
523 |
+
<div class="inside">
|
524 |
+
<h3><?php _e( 'Cookies', 'wp-accessibility' ); ?></h3>
|
525 |
+
<p><?php _e( 'The accessibility toolbar sets cookies to maintain awareness of the user\'s selected accessibility options. If the toolbar is not in use, WP Accessibility does not set any cookies.', 'wp-accessibility' ); ?></p>
|
526 |
+
<h3><?php _e( 'Information Collected by WP Accessibility', 'wp-accessibility' ); ?></h3>
|
527 |
+
<p><?php _e( 'WP Accessibility does not collect any private information about users or visitors.', 'wp-accessibility' ); ?></p>
|
528 |
+
</div>
|
529 |
+
</div>
|
530 |
+
<div class="postbox" id="get-support">
|
531 |
+
<h2 class='hndle'><?php _e( 'Get Plug-in Support', 'wp-accessibility' ); ?></h2>
|
532 |
+
|
533 |
+
<div class="inside">
|
534 |
+
<div class='wpa-support-me'>
|
535 |
+
<p>
|
536 |
+
<?php
|
537 |
+
// Translators: URL to donate.
|
538 |
+
printf( __( 'Please, consider <a href="%s">making a donation</a> to support WP Accessibility!', 'wp-accessibility' ), 'https://www.joedolson.com/donate/' );
|
539 |
+
?>
|
540 |
+
</p>
|
541 |
+
</div>
|
542 |
+
<?php wpa_get_support_form(); ?>
|
543 |
+
</div>
|
544 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
</div>
|
546 |
</div>
|
547 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
548 |
|
549 |
+
<div class="postbox-container" style="width:20%">
|
550 |
+
<div class="metabox-holder">
|
551 |
+
<div class="ui-sortable meta-box-sortables">
|
552 |
+
<div class="postbox">
|
553 |
+
<h2 class='hndle'><?php _e( 'Support this Plugin', 'wp-accessibility' ); ?></h2>
|
554 |
+
|
555 |
+
<div class="inside">
|
556 |
+
<p>
|
557 |
+
<a href="https://twitter.com/intent/follow?screen_name=joedolson" class="twitter-follow-button" data-size="small" data-related="joedolson">Follow @joedolson</a>
|
558 |
+
<script>!function (d, s, id) {
|
559 |
+
var js, fjs = d.getElementsByTagName(s)[0];
|
560 |
+
if (!d.getElementById(id)) {
|
561 |
+
js = d.createElement(s);
|
562 |
+
js.id = id;
|
563 |
+
js.src = "https://platform.twitter.com/widgets.js";
|
564 |
+
fjs.parentNode.insertBefore(js, fjs);
|
565 |
+
}
|
566 |
+
}(document, "script", "twitter-wjs");</script>
|
567 |
+
</p>
|
568 |
+
<p><?php _e( "If you've found WP Accessibility useful, then please <a href='https://wordpress.org/plugins/wp-accessibility/'>rate it five stars</a>, <a href='https://www.joedolson.com/donate/'>make a donation</a>, or <a href='https://translate.wordpress.org/projects/wp-plugins/wp-accessibility'>help with translation</a>.", 'wp-accessibility' ); ?></p>
|
569 |
|
|
|
570 |
<div>
|
571 |
+
<p><?php _e( '<a href="http://www.joedolson.com/donate/">Make a donation today!</a> Your donation counts - donate any amount to help keep this plug-in running!', 'wp-accessibility' ); ?></p>
|
572 |
+
|
573 |
+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
574 |
+
<div>
|
575 |
+
<input type="hidden" name="cmd" value="_s-xclick"/>
|
576 |
+
<input type="hidden" name="hosted_button_id" value="QK9MXYGQKYUZY"/>
|
577 |
+
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="Donate"/>
|
578 |
+
<img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/>
|
579 |
+
</div>
|
580 |
+
</form>
|
581 |
</div>
|
582 |
+
</div>
|
583 |
</div>
|
584 |
</div>
|
|
|
|
|
585 |
|
586 |
+
<div class="ui-sortable meta-box-sortables">
|
587 |
+
<div class="postbox">
|
588 |
+
<h2 class='hndle'><?php _e( 'Access Monitor', 'wp-accessibility' ); ?></h2>
|
589 |
+
|
590 |
+
<div class="inside">
|
591 |
+
<p>
|
592 |
+
<?php
|
593 |
+
// Translators: URL to visit Access Monitor at WordPress.org.
|
594 |
+
printf( __( 'Try using <a href="%s">Access Monitor</a> to do scheduled and on-demand evaluations of your web site accessibility.', 'wp-accessibility' ), 'https://wordpress.org/plugins/access-monitor/' );
|
595 |
+
?>
|
596 |
+
</p>
|
597 |
+
</div>
|
598 |
+
</div>
|
599 |
</div>
|
|
|
|
|
600 |
|
601 |
+
<div class="ui-sortable meta-box-sortables">
|
602 |
+
<div class="postbox">
|
603 |
+
<h2 class='hndle'><?php _e( 'Accessibility References', 'wp-accessibility' ); ?></h2>
|
604 |
+
|
605 |
+
<div class="inside">
|
606 |
+
<ul>
|
607 |
+
<li><a href="http://make.wordpress.org/accessibility/wp-accessibility-plugin/">Documentation</a></li>
|
608 |
+
<li><a href="http://make.wordpress.org/accessibility/">Make WordPress: Accessibility</a></li>
|
609 |
+
<li><a href="https://make.wordpress.org/themes/handbook/review/accessibility/">WordPress Theme Accessibility Guidelines</a></li>
|
610 |
+
<li><a href="http://make.wordpress.org/support/user-manual/web-publishing/accessibility/">WordPress User Manual: Accessibility</a></li>
|
611 |
+
<li><a href="https://www.joedolson.com/tools/color-contrast.php">Test Color Contrast</a></li>
|
612 |
+
<li><a href="http://wave.webaim.org/">WAVE: Web accessibility evaluation tool</a></li>
|
613 |
+
<li><a href="https://www.linkedin.com/learning/wordpress-accessibility-2/">WordPress Accessibility at LinkedIn Learning</a></li>
|
614 |
+
</ul>
|
615 |
+
</div>
|
616 |
+
</div>
|
617 |
</div>
|
|
|
|
|
618 |
|
619 |
+
<div class="ui-sortable meta-box-sortables">
|
620 |
+
<div class="postbox">
|
621 |
+
<h2 class='hndle'><?php _e( 'Customization Notes', 'wp-accessibility' ); ?></h2>
|
622 |
+
|
623 |
+
<div class="inside">
|
624 |
+
<p>
|
625 |
+
<?php _e( 'It is almost impossible for the Accessibility Toolbar to guarantee a good result for large text or high contrast modes.', 'wp-accessibility' ); ?>
|
626 |
+
</p>
|
627 |
+
<p>
|
628 |
+
<?php _e( 'Author high-contrast styles by placing a stylesheet called <code>a11y-contrast.css</code> in your Theme\'s stylesheet directory.', 'wp-accessibility' ); ?>
|
629 |
+
</p>
|
630 |
+
<p>
|
631 |
+
<?php _e( 'Define custom styles for large print by assigning them in the body class <code>.fontsize</code> in your theme stylesheet.', 'wp-accessibility' ); ?>
|
632 |
+
</p>
|
633 |
+
<p>
|
634 |
+
<?php _e( 'Define a custom long description template by adding the template "longdesc-template.php" to your theme directory.', 'wp-accessibility' ); ?>
|
635 |
+
</p>
|
636 |
+
<p>
|
637 |
+
<?php _e( 'The <a href="#wpa_widget_toolbar">shortcode for the Accessibility toolbar</a> (if enabled) is <code>[wpa_toolbar]</code>', 'wp-accessibility' ); ?>
|
638 |
+
</p>
|
639 |
+
</div>
|
640 |
+
</div>
|
641 |
</div>
|
|
|
|
|
642 |
|
643 |
+
<?php if ( wpa_accessible_theme() ) { ?>
|
644 |
+
<div class="ui-sortable meta-box-sortables">
|
645 |
+
<div class="postbox">
|
646 |
+
<h2 class='hndle'><?php _e( 'Your Theme', 'wp-accessibility' ); ?></h2>
|
647 |
+
|
648 |
+
<div class="inside">
|
649 |
+
<p>
|
650 |
+
<?php _e( "You're using a theme reviewed as <code>accessibility-ready</code> by the WordPress theme review team. Some options have been disabled in WP Accessibility because your theme has taken care of that issue.", 'wp-accessibility' ); ?>
|
651 |
+
</p>
|
652 |
+
<p>
|
653 |
+
<?php
|
654 |
+
// Translators: URL to read about the accessibility ready tag requirements.
|
655 |
+
printf( __( 'Read more about the <a href="%s">WordPress accessibility-ready tag</a>', 'wp-accessibility' ), 'https://make.wordpress.org/themes/handbook/review/accessibility/' );
|
656 |
+
?>
|
657 |
+
</p>
|
658 |
+
</div>
|
659 |
+
</div>
|
660 |
</div>
|
661 |
+
<?php } ?>
|
|
|
|
|
662 |
|
663 |
|
664 |
+
<div class="ui-sortable meta-box-sortables">
|
665 |
+
<div class="postbox">
|
666 |
+
<h2 class='hndle'><?php _e( 'Contributing References', 'wp-accessibility' ); ?></h2>
|
667 |
|
668 |
+
<div class="inside">
|
669 |
+
<ul>
|
670 |
+
<li><a href="http://www.accessibleculture.org/articles/2010/08/continue-reading-links-in-wordpress/">Continue Reading Links in WordPress</a></li>
|
671 |
+
<li><a href="http://www.mothereffingtoolconfuser.com">Mother Effing Tool Confuser</a></li>
|
672 |
+
<li><a href="https://wordpress.org/extend/plugins/remove-title-attributes/">Remove Title Attributes</a></li>
|
673 |
+
<li><a href="https://wordpress.org/extend/plugins/img-title-removal/">IMG Title Removal</a></li>
|
674 |
+
</ul>
|
675 |
+
</div>
|
676 |
+
</div>
|
677 |
</div>
|
|
|
|
|
678 |
|
679 |
|
680 |
+
</div>
|
681 |
+
</div>
|
682 |
|
683 |
</div>
|
684 |
<?php
|
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.7.
|
21 |
*/
|
22 |
|
23 |
/*
|
@@ -69,7 +69,7 @@ function wpa_admin_menu() {
|
|
69 |
* Install on activation.
|
70 |
*/
|
71 |
function wpa_install() {
|
72 |
-
$wpa_version = '1.7.
|
73 |
if ( 'true' !== get_option( 'wpa_installed' ) ) {
|
74 |
add_option( 'rta_from_nav_menu', 'on' );
|
75 |
add_option( 'rta_from_page_lists', 'on' );
|
@@ -149,9 +149,12 @@ function wpacc_enqueue_scripts() {
|
|
149 |
}
|
150 |
if ( 'link' === get_option( 'wpa_longdesc' ) ) {
|
151 |
wp_enqueue_script( 'longdesc.link', plugins_url( 'js/longdesc.link.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
|
|
152 |
}
|
153 |
if ( 'jquery' === get_option( 'wpa_longdesc' ) ) {
|
154 |
wp_enqueue_script( 'longdesc.button', plugins_url( 'js/longdesc.button.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
|
|
|
|
155 |
}
|
156 |
wp_enqueue_script( 'current.menu', plugins_url( 'js/current-menu-item.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
157 |
}
|
17 |
* Domain Path: /lang
|
18 |
* License: GPL-2.0+
|
19 |
* License URI: http://www.gnu.org/license/gpl-2.0.txt
|
20 |
+
* Version: 1.7.4
|
21 |
*/
|
22 |
|
23 |
/*
|
69 |
* Install on activation.
|
70 |
*/
|
71 |
function wpa_install() {
|
72 |
+
$wpa_version = '1.7.4';
|
73 |
if ( 'true' !== get_option( 'wpa_installed' ) ) {
|
74 |
add_option( 'rta_from_nav_menu', 'on' );
|
75 |
add_option( 'rta_from_page_lists', 'on' );
|
149 |
}
|
150 |
if ( 'link' === get_option( 'wpa_longdesc' ) ) {
|
151 |
wp_enqueue_script( 'longdesc.link', plugins_url( 'js/longdesc.link.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
152 |
+
wp_localize_script( 'longdesc.link', 'wparest', get_rest_url( null, 'wp/v2/media' ) );
|
153 |
}
|
154 |
if ( 'jquery' === get_option( 'wpa_longdesc' ) ) {
|
155 |
wp_enqueue_script( 'longdesc.button', plugins_url( 'js/longdesc.button.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
156 |
+
wp_localize_script( 'longdesc.button', 'wparest', get_rest_url( null, 'wp/v2/media' ) );
|
157 |
+
wp_localize_script( 'longdesc.button', 'wpatext', '<span>' . __( 'Long Description', 'wp-accessibility' ) . '</span>' );
|
158 |
}
|
159 |
wp_enqueue_script( 'current.menu', plugins_url( 'js/current-menu-item.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
160 |
}
|