Version Description
- Add style to div.aligncenter to control width
Download this release
Release Info
Developer | joedolson |
Plugin | WP Accessibility |
Version | 1.7.2 |
Comparing to | |
See all releases |
Code changes from version 1.7.1 to 1.7.2
- css/wpa-style.css +1 -0
- readme.txt +29 -17
- toolbar/css/a11y.css +85 -72
- wp-accessibility-settings.php +0 -1
- wp-accessibility-toolbar.php +59 -0
- wp-accessibility.php +6 -51
css/wpa-style.css
CHANGED
@@ -29,6 +29,7 @@ div.alignright {
|
|
29 |
div.aligncenter {
|
30 |
display: block;
|
31 |
margin: 0 auto;
|
|
|
32 |
}
|
33 |
|
34 |
.wpa-ld a, .wpa-ld button {
|
29 |
div.aligncenter {
|
30 |
display: block;
|
31 |
margin: 0 auto;
|
32 |
+
width: fit-content;
|
33 |
}
|
34 |
|
35 |
.wpa-ld a, .wpa-ld button {
|
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 |
|
@@ -15,33 +15,42 @@ WP Accessibility fixes common accessibility issues in your WordPress site.
|
|
15 |
|
16 |
This plug-in helps with a variety of common accessibility problems in WordPress themes. While most accessibility issues can't be addressed without directly changing your theme, WP Accessibility adds a number of helpful accessibility features with a minimum amount of setup or expert knowledge.
|
17 |
|
|
|
|
|
18 |
All features can be disabled according to your theme's needs. For advanced users, all of the functions based on modifying stylesheets can be customized using your own custom styles by placing the appropriate stylesheet in your theme directory.
|
19 |
|
20 |
-
= Accessibility Features added by WP Accessibility
|
|
|
|
|
21 |
|
22 |
-
* Enable skip links with WebKit support by adding JavaScript support to move keyboard focus.
|
23 |
* Add skip links with user-defined targets. (Customizable targets and appearance.)
|
24 |
-
* Add language and text direction attributes to your HTML attribute
|
25 |
* Add an outline to the keyboard focus state for focusable elements.
|
26 |
-
* Add a toolbar toggling between high contrast, large print, and desaturated (grayscale) views of your theme.
|
27 |
* Add a long description to images. Use the image's "Description" field to add long descriptions.
|
28 |
-
* Enforcement for alt attributes on images.
|
29 |
-
*
|
|
|
|
|
|
|
30 |
|
31 |
-
= Accessibility Issues fixed by WP Accessibility
|
|
|
|
|
32 |
|
33 |
-
* Remove the target attribute from links.
|
34 |
* Force a search page error when a search is made with an empty text string. (If your theme has a search.php template.)
|
35 |
-
* Remove tabindex from elements that are focusable.
|
36 |
-
* Strip title attributes from images inserted into content.
|
37 |
* Remove redundant title attributes from page lists, category lists, and archive menus.
|
38 |
-
* Add post titles to standard "read more" links.
|
39 |
* Address some accessibility issues in the WordPress admin styles
|
40 |
-
* Add labels to standard WordPress form fields if missing
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
|
|
|
|
|
45 |
* Enable diagnostic CSS to show CSS-detectable problems in visual editor or on front-end of site.
|
46 |
|
47 |
Learn more! <a href="http://make.wordpress.org/accessibility/wp-accessibility-plugin/">Read about the accessibility issues corrected</a> by WP Accessibility!
|
@@ -64,7 +73,10 @@ The plug-in is intended to help with deficiencies commonly found in themes and t
|
|
64 |
= Future =
|
65 |
|
66 |
[Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
|
67 |
-
|
|
|
|
|
|
|
68 |
|
69 |
= 1.7.1 =
|
70 |
|
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.5
|
8 |
+
Stable tag: 1.7.2
|
9 |
Text Domain: wp-accessibility
|
10 |
License: GPLv2 or later
|
11 |
|
15 |
|
16 |
This plug-in helps with a variety of common accessibility problems in WordPress themes. While most accessibility issues can't be addressed without directly changing your theme, WP Accessibility adds a number of helpful accessibility features with a minimum amount of setup or expert knowledge.
|
17 |
|
18 |
+
WP Accessibility is not intended to make your site compatible with any accessibility guidelines.
|
19 |
+
|
20 |
All features can be disabled according to your theme's needs. For advanced users, all of the functions based on modifying stylesheets can be customized using your own custom styles by placing the appropriate stylesheet in your theme directory.
|
21 |
|
22 |
+
= Theme Accessibility Features added by WP Accessibility =
|
23 |
+
|
24 |
+
These are features that address issues caused by inaccessible themes.
|
25 |
|
|
|
26 |
* Add skip links with user-defined targets. (Customizable targets and appearance.)
|
27 |
+
* Add language and text direction attributes to your HTML attribute if missing.
|
28 |
* Add an outline to the keyboard focus state for focusable elements.
|
|
|
29 |
* Add a long description to images. Use the image's "Description" field to add long descriptions.
|
30 |
+
* Enforcement for alt attributes on images in the Classic editor.
|
31 |
+
* Identify images without alt attributes in the Media Library
|
32 |
+
* Add labels to standard WordPress form fields (search, comments)
|
33 |
+
* Add post titles to "read more" links.
|
34 |
+
* Remove tabindex from elements that are focusable. (Also fixes plugin-caused problems.)
|
35 |
|
36 |
+
= WordPress Core Accessibility Issues fixed by WP Accessibility =
|
37 |
+
|
38 |
+
These are features that address issues caused by current or past WordPress core accessibility issues. (Issues added in content, such as target or title attributes, are persistent even when WordPress is updated.)
|
39 |
|
|
|
40 |
* Force a search page error when a search is made with an empty text string. (If your theme has a search.php template.)
|
|
|
|
|
41 |
* Remove redundant title attributes from page lists, category lists, and archive menus.
|
|
|
42 |
* Address some accessibility issues in the WordPress admin styles
|
|
|
43 |
|
44 |
+
Content specific fixes:
|
45 |
+
|
46 |
+
* Strip title attributes from images inserted into content.
|
47 |
+
* Remove the target attribute from links.
|
48 |
+
|
49 |
+
= Accessibility Tools in WP Accessibility: =
|
50 |
|
51 |
+
These are tools provided to help you identify issues you may need to fix.
|
52 |
+
|
53 |
+
* Test the color contrast between two provided hexadecimal color values.
|
54 |
* Enable diagnostic CSS to show CSS-detectable problems in visual editor or on front-end of site.
|
55 |
|
56 |
Learn more! <a href="http://make.wordpress.org/accessibility/wp-accessibility-plugin/">Read about the accessibility issues corrected</a> by WP Accessibility!
|
73 |
= Future =
|
74 |
|
75 |
[Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
|
76 |
+
|
77 |
+
= 1.7.2 =
|
78 |
+
|
79 |
+
* Add style to div.aligncenter to control width
|
80 |
|
81 |
= 1.7.1 =
|
82 |
|
toolbar/css/a11y.css
CHANGED
@@ -9,139 +9,151 @@
|
|
9 |
}
|
10 |
}
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
.focusable:focus {
|
13 |
-
|
14 |
}
|
15 |
|
16 |
.has-focus {
|
17 |
-
|
18 |
}
|
19 |
|
20 |
/* reset styles */
|
21 |
.a11y-toolbar button {
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
}
|
34 |
|
35 |
.a11y-toolbar {
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
}
|
41 |
|
42 |
.a11y-toolbar ul {
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
}
|
49 |
|
50 |
.a11y-toolbar ul li {
|
51 |
margin: 0;
|
52 |
padding: 0;
|
53 |
-
|
54 |
}
|
55 |
|
56 |
.a11y-toolbar ul li button {
|
57 |
-
|
58 |
-
|
59 |
}
|
60 |
|
61 |
.a11y-toolbar button {
|
62 |
-
|
63 |
}
|
64 |
|
65 |
.a11y-toolbar button.active {
|
66 |
-
|
67 |
}
|
68 |
|
69 |
.a11y-toolbar ul li button {
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
position: relative;
|
76 |
}
|
77 |
|
78 |
.a11y-toolbar ul li button:hover {
|
79 |
-
|
80 |
}
|
81 |
|
82 |
.a11y-toolbar ul li button.active {
|
83 |
-
|
84 |
-
|
85 |
}
|
86 |
|
87 |
.a11y-toolbar ul li:first-child button {
|
88 |
-
|
89 |
}
|
90 |
|
91 |
.a11y-toolbar ul li:last-child button {
|
92 |
-
|
93 |
}
|
94 |
|
95 |
|
96 |
-
.a11y-toolbar .offscreen,
|
97 |
-
|
98 |
-
|
|
|
99 |
clip-path: polygon(0px 0px, 0px 0px,0px 0px, 0px 0px);
|
100 |
white-space: nowrap;
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-webkit-transition: width .3s, clip .3s, clip-path .3s, background-color .5s;
|
107 |
transition: width .3s, clip .3s, clip-path .3s, background-color .5s;
|
108 |
}
|
109 |
|
110 |
/* a11y toolbar RTL */
|
111 |
-
.a11y-toolbar.rtl,
|
112 |
-
|
113 |
-
|
|
|
114 |
}
|
115 |
|
116 |
-
.a11y-toolbar.rtl ul,
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
121 |
}
|
122 |
|
123 |
-
.a11y-toolbar.rtl ul li:first-child button,
|
124 |
-
|
125 |
-
|
|
|
126 |
}
|
127 |
|
128 |
-
.a11y-toolbar.rtl ul li:last-child button,
|
129 |
-
|
130 |
-
|
|
|
131 |
}
|
132 |
|
133 |
.desaturated {
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
}
|
143 |
-
|
144 |
-
.a11y-toolbar button:hover .offscreen,
|
|
|
145 |
height: auto !important;
|
146 |
width: 12em !important;
|
147 |
clip: unset !important;
|
@@ -158,11 +170,12 @@
|
|
158 |
display: block;
|
159 |
}
|
160 |
|
161 |
-
.a11y-toolbar.right
|
|
|
162 |
right: 3em;
|
163 |
left: auto;
|
164 |
}
|
165 |
|
166 |
-
.a11y-toolbar
|
167 |
left: 3em;
|
168 |
}
|
9 |
}
|
10 |
}
|
11 |
|
12 |
+
@media print {
|
13 |
+
.a11y-toolbar {
|
14 |
+
/*display: none;*/
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
.focusable:focus {
|
19 |
+
outline: none !important;
|
20 |
}
|
21 |
|
22 |
.has-focus {
|
23 |
+
background: yellow;
|
24 |
}
|
25 |
|
26 |
/* reset styles */
|
27 |
.a11y-toolbar button {
|
28 |
+
border: 0;
|
29 |
+
color: inherit;
|
30 |
+
background-color: transparent;
|
31 |
+
text-decoration: none;
|
32 |
+
padding: 0;
|
33 |
+
line-height: inherit;
|
34 |
+
margin: 0;
|
35 |
+
font: inherit;
|
36 |
+
width: 100%;
|
37 |
+
height: 100%;
|
38 |
+
text-align: left;
|
39 |
}
|
40 |
|
41 |
.a11y-toolbar {
|
42 |
+
position: fixed;
|
43 |
+
z-index: 99999;
|
44 |
+
top: 43%;
|
45 |
+
left: 0;
|
46 |
}
|
47 |
|
48 |
.a11y-toolbar ul {
|
49 |
+
list-style: none;
|
50 |
+
margin: 0;
|
51 |
+
padding: 0;
|
52 |
+
border-top-right-radius: 4px;
|
53 |
+
border-bottom-right-radius: 4px;
|
54 |
}
|
55 |
|
56 |
.a11y-toolbar ul li {
|
57 |
margin: 0;
|
58 |
padding: 0;
|
59 |
+
display: block;
|
60 |
}
|
61 |
|
62 |
.a11y-toolbar ul li button {
|
63 |
+
font-size: 1.6em;
|
64 |
+
padding: .25em;
|
65 |
}
|
66 |
|
67 |
.a11y-toolbar button {
|
68 |
+
color: #000 !important;
|
69 |
}
|
70 |
|
71 |
.a11y-toolbar button.active {
|
72 |
+
color: #fff !important;
|
73 |
}
|
74 |
|
75 |
.a11y-toolbar ul li button {
|
76 |
+
display: block;
|
77 |
+
background: #e2e2e2;
|
78 |
+
text-align: center;
|
79 |
+
border-top: 1px solid #f5f5f5;
|
80 |
+
border-bottom: 1px solid #d2d2d2;
|
81 |
position: relative;
|
82 |
}
|
83 |
|
84 |
.a11y-toolbar ul li button:hover {
|
85 |
+
background: #fff;
|
86 |
}
|
87 |
|
88 |
.a11y-toolbar ul li button.active {
|
89 |
+
background: #181818;
|
90 |
+
border-bottom: 1px solid #525252;
|
91 |
}
|
92 |
|
93 |
.a11y-toolbar ul li:first-child button {
|
94 |
+
border-top-right-radius: 4px;
|
95 |
}
|
96 |
|
97 |
.a11y-toolbar ul li:last-child button {
|
98 |
+
border-bottom-right-radius: 4px;
|
99 |
}
|
100 |
|
101 |
|
102 |
+
.a11y-toolbar .offscreen,
|
103 |
+
.a11y_stylesheet_path {
|
104 |
+
position: absolute !important;
|
105 |
+
clip: rect(1px, 1px, 1px, 1px);
|
106 |
clip-path: polygon(0px 0px, 0px 0px,0px 0px, 0px 0px);
|
107 |
white-space: nowrap;
|
108 |
+
padding: 0 !important;
|
109 |
+
border: 0 !important;
|
110 |
+
height: 1px !important;
|
111 |
+
width: 1px !important;
|
112 |
+
overflow: hidden;
|
113 |
-webkit-transition: width .3s, clip .3s, clip-path .3s, background-color .5s;
|
114 |
transition: width .3s, clip .3s, clip-path .3s, background-color .5s;
|
115 |
}
|
116 |
|
117 |
/* a11y toolbar RTL */
|
118 |
+
.a11y-toolbar.rtl,
|
119 |
+
.a11y-toolbar.right {
|
120 |
+
right: 0;
|
121 |
+
left: auto;
|
122 |
}
|
123 |
|
124 |
+
.a11y-toolbar.rtl ul,
|
125 |
+
.a11y-toolbar.right ul {
|
126 |
+
border-top-left-radius: 4px;
|
127 |
+
border-bottom-left-radius: 4px;
|
128 |
+
border-top-right-radius: 0;
|
129 |
+
border-bottom-right-radius: 0;
|
130 |
}
|
131 |
|
132 |
+
.a11y-toolbar.rtl ul li:first-child button,
|
133 |
+
.a11y-toolbar.right ul li:first-child button {
|
134 |
+
border-top-left-radius: 4px;
|
135 |
+
border-top-right-radius: 0;
|
136 |
}
|
137 |
|
138 |
+
.a11y-toolbar.rtl ul li:last-child button,
|
139 |
+
.a11y-toolbar.right ul li:last-child button {
|
140 |
+
border-bottom-left-radius: 4px;
|
141 |
+
border-bottom-right-radius: 0;
|
142 |
}
|
143 |
|
144 |
.desaturated {
|
145 |
+
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale") !important;
|
146 |
+
filter: grayscale(100%) !important;
|
147 |
+
-webkit-filter: grayscale(100%) !important;
|
148 |
+
-webkit-filter: grayscale(1) !important;
|
149 |
+
-moz-filter: grayscale(100%) !important;
|
150 |
+
-ms-filter: grayscale(100%) !important;
|
151 |
+
-o-filter: grayscale(100%) !important;
|
152 |
+
filter: gray !important;
|
153 |
+
}
|
154 |
+
|
155 |
+
.a11y-toolbar button:hover .offscreen,
|
156 |
+
.a11y-toolbar button:focus .offscreen {
|
157 |
height: auto !important;
|
158 |
width: 12em !important;
|
159 |
clip: unset !important;
|
170 |
display: block;
|
171 |
}
|
172 |
|
173 |
+
.a11y-toolbar.right button:hover .offscreen,
|
174 |
+
.a11y-toolbar.right button:focus .offscreen {
|
175 |
right: 3em;
|
176 |
left: auto;
|
177 |
}
|
178 |
|
179 |
+
.a11y-toolbar button:hover .offscreen, .a11y-toolbar button:focus .offscreen {
|
180 |
left: 3em;
|
181 |
}
|
wp-accessibility-settings.php
CHANGED
@@ -672,7 +672,6 @@ function wpa_admin_settings() {
|
|
672 |
<li><a href="http://www.mothereffingtoolconfuser.com">Mother Effing Tool Confuser</a></li>
|
673 |
<li><a href="http://wordpress.org/extend/plugins/remove-title-attributes/">Remove Title Attributes</a></li>
|
674 |
<li><a href="http://wordpress.org/extend/plugins/img-title-removal/">IMG Title Removal</a></li>
|
675 |
-
<li><a href="https://github.com/clrux/a11y">Accessibility Toolbar</a></li>
|
676 |
<li><a href="https://wordpress.org/plugins/long-description-for-image-attachments/">WordPress Long Description</a></li>
|
677 |
</ul>
|
678 |
</div>
|
672 |
<li><a href="http://www.mothereffingtoolconfuser.com">Mother Effing Tool Confuser</a></li>
|
673 |
<li><a href="http://wordpress.org/extend/plugins/remove-title-attributes/">Remove Title Attributes</a></li>
|
674 |
<li><a href="http://wordpress.org/extend/plugins/img-title-removal/">IMG Title Removal</a></li>
|
|
|
675 |
<li><a href="https://wordpress.org/plugins/long-description-for-image-attachments/">WordPress Long Description</a></li>
|
676 |
</ul>
|
677 |
</div>
|
wp-accessibility-toolbar.php
CHANGED
@@ -9,6 +9,65 @@
|
|
9 |
* @link https://www.joedolson.com/wp-accessibility/
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
add_shortcode( 'wpa_toolbar', 'wpa_toolbar_shortcode' );
|
13 |
/**
|
14 |
* Output Toolbar shortcode
|
9 |
* @link https://www.joedolson.com/wp-accessibility/
|
10 |
*/
|
11 |
|
12 |
+
/**
|
13 |
+
* Toolbar class.
|
14 |
+
*/
|
15 |
+
require_once( dirname( __FILE__ ) . '/class-wp-accessibility-toolbar.php' );
|
16 |
+
|
17 |
+
add_action( 'widgets_init', 'wpa_register_toolbar_widget' );
|
18 |
+
/**
|
19 |
+
* Register toolbar widget.
|
20 |
+
*/
|
21 |
+
function wpa_register_toolbar_widget() {
|
22 |
+
register_widget( 'Wp_Accessibility_Toolbar' );
|
23 |
+
}
|
24 |
+
|
25 |
+
add_action( 'wp_enqueue_scripts', 'wpa_toolbar_enqueue_scripts' );
|
26 |
+
/**
|
27 |
+
* Enqueue Toolbar scripts dependent on options.
|
28 |
+
*/
|
29 |
+
function wpa_toolbar_enqueue_scripts() {
|
30 |
+
wp_enqueue_script( 'jquery' );
|
31 |
+
if ( 'on' === get_option( 'wpa_toolbar' ) || 'on' === get_option( 'wpa_widget_toolbar' ) ) {
|
32 |
+
if ( 'on' === get_option( 'wpa_toolbar' ) ) {
|
33 |
+
// Enqueue Toolbar JS if enabled.
|
34 |
+
wp_enqueue_script( 'wpa-toolbar' );
|
35 |
+
wp_localize_script( 'wpa-toolbar', 'wpa', wpa_toolbar_js() );
|
36 |
+
}
|
37 |
+
wp_enqueue_script( 'ui-a11y.js' );
|
38 |
+
$plugin_path = plugins_url( 'wp-accessibility/toolbar/css/a11y-contrast.css' );
|
39 |
+
if ( file_exists( get_stylesheet_directory() . '/a11y-contrast.css' ) ) {
|
40 |
+
$plugin_path = get_stylesheet_directory_uri() . '/a11y-contrast.css';
|
41 |
+
}
|
42 |
+
wp_localize_script( 'ui-a11y.js', 'a11y_stylesheet_path', $plugin_path );
|
43 |
+
}
|
44 |
+
wp_register_style( 'ui-font.css', plugins_url( 'toolbar/fonts/css/a11y-toolbar.css', __FILE__ ) );
|
45 |
+
$toolbar = apply_filters( 'wpa_toolbar_css', plugins_url( 'toolbar/css/a11y.css', __FILE__ ) );
|
46 |
+
wp_register_style( 'ui-a11y.css', $toolbar, array( 'ui-font.css' ) );
|
47 |
+
$fontsize_stylesheet = ( 'on' === get_option( 'wpa_alternate_fontsize' ) ) ? 'a11y-fontsize-alt' : 'a11y-fontsize';
|
48 |
+
$fontsize = apply_filters( 'wpa_fontsize_css', plugins_url( 'toolbar/css/' . $fontsize_stylesheet . '.css', __FILE__ ) );
|
49 |
+
wp_register_style( 'ui-fontsize.css', $fontsize );
|
50 |
+
$toolbar_size = get_option( 'wpa_toolbar_size' );
|
51 |
+
$toolbar_size = ( false === stripos( $toolbar_size, 'em' ) ) ? $toolbar_size . 'px' : $toolbar_size;
|
52 |
+
// Only enable styles when required by options.
|
53 |
+
if ( get_option( 'wpa_toolbar_size' ) && 'on' === get_option( 'wpa_toolbar' ) ) {
|
54 |
+
wp_add_inline_style( 'ui-a11y.css', '.a11y-toolbar ul li button { font-size: ' . $toolbar_size . ' !important; }' );
|
55 |
+
}
|
56 |
+
if ( 'on' === get_option( 'wpa_toolbar' ) || 'on' === get_option( 'wpa_widget_toolbar' ) && ( $toolbar && $fontsize ) ) {
|
57 |
+
wp_enqueue_style( 'ui-a11y.css' );
|
58 |
+
wp_enqueue_style( 'ui-fontsize.css' );
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
add_action( 'wp_enqueue_scripts', 'wpa_register_scripts' );
|
63 |
+
/**
|
64 |
+
* Register jQuery scripts.
|
65 |
+
*/
|
66 |
+
function wpa_register_scripts() {
|
67 |
+
wp_register_script( 'wpa-toolbar', plugins_url( 'wp-accessibility/js/wpa-toolbar.js' ), array( 'jquery' ), '1.0', true );
|
68 |
+
wp_register_script( 'ui-a11y.js', plugins_url( 'wp-accessibility/toolbar/js/a11y.js' ), array( 'jquery' ), '1.0', true );
|
69 |
+
}
|
70 |
+
|
71 |
add_shortcode( 'wpa_toolbar', 'wpa_toolbar_shortcode' );
|
72 |
/**
|
73 |
* Output Toolbar shortcode
|
wp-accessibility.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @package WP Accessibility
|
6 |
* @author Joe Dolson
|
7 |
-
* @copyright 2012-
|
8 |
* @license GPL-2.0+
|
9 |
*
|
10 |
* @wordpress-plugin
|
@@ -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 |
/*
|
@@ -38,8 +38,9 @@
|
|
38 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
39 |
*/
|
40 |
|
41 |
-
|
42 |
-
require_once( dirname( __FILE__ ) . '/wp-accessibility-toolbar.php' );
|
|
|
43 |
require_once( dirname( __FILE__ ) . '/wp-accessibility-longdesc.php' );
|
44 |
require_once( dirname( __FILE__ ) . '/wp-accessibility-alt.php' );
|
45 |
require_once( dirname( __FILE__ ) . '/wp-accessibility-contrast.php' );
|
@@ -68,7 +69,7 @@ function wpa_admin_menu() {
|
|
68 |
* Install on activation.
|
69 |
*/
|
70 |
function wpa_install() {
|
71 |
-
$wpa_version = '1.7.
|
72 |
if ( 'true' !== get_option( 'wpa_installed' ) ) {
|
73 |
add_option( 'rta_from_nav_menu', 'on' );
|
74 |
add_option( 'rta_from_page_lists', 'on' );
|
@@ -120,34 +121,12 @@ function wpa_plugin_action( $links, $file ) {
|
|
120 |
return $links;
|
121 |
}
|
122 |
|
123 |
-
add_action( 'wp_enqueue_scripts', 'wpa_register_scripts' );
|
124 |
-
/**
|
125 |
-
* Register jQuery scripts.
|
126 |
-
*/
|
127 |
-
function wpa_register_scripts() {
|
128 |
-
wp_register_script( 'wpa-toolbar', plugins_url( 'wp-accessibility/js/wpa-toolbar.js' ), array( 'jquery' ), '1.0', true );
|
129 |
-
wp_register_script( 'ui-a11y.js', plugins_url( 'wp-accessibility/toolbar/js/a11y.js' ), array( 'jquery' ), '1.0', true );
|
130 |
-
}
|
131 |
-
|
132 |
add_action( 'wp_enqueue_scripts', 'wpacc_enqueue_scripts' );
|
133 |
/**
|
134 |
* Enqueue accessibility scripts dependent on options.
|
135 |
*/
|
136 |
function wpacc_enqueue_scripts() {
|
137 |
wp_enqueue_script( 'jquery' );
|
138 |
-
if ( 'on' === get_option( 'wpa_toolbar' ) || 'on' === get_option( 'wpa_widget_toolbar' ) ) {
|
139 |
-
if ( 'on' === get_option( 'wpa_toolbar' ) ) {
|
140 |
-
// Enqueue Toolbar JS if enabled.
|
141 |
-
wp_enqueue_script( 'wpa-toolbar' );
|
142 |
-
wp_localize_script( 'wpa-toolbar', 'wpa', wpa_toolbar_js() );
|
143 |
-
}
|
144 |
-
wp_enqueue_script( 'ui-a11y.js' );
|
145 |
-
$plugin_path = plugins_url( 'wp-accessibility/toolbar/css/a11y-contrast.css' );
|
146 |
-
if ( file_exists( get_stylesheet_directory() . '/a11y-contrast.css' ) ) {
|
147 |
-
$plugin_path = get_stylesheet_directory_uri() . '/a11y-contrast.css';
|
148 |
-
}
|
149 |
-
wp_localize_script( 'ui-a11y.js', 'a11y_stylesheet_path', $plugin_path );
|
150 |
-
}
|
151 |
if ( 'on' === get_option( 'wpa_insert_roles' ) ) {
|
152 |
wp_enqueue_script( 'wpa-complementary', plugins_url( 'js/roles.jquery.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
153 |
if ( get_option( 'wpa_complementary_container' ) ) {
|
@@ -184,25 +163,9 @@ add_action( 'wp_enqueue_scripts', 'wpa_stylesheet' );
|
|
184 |
function wpa_stylesheet() {
|
185 |
// Respects SSL, Style.css is relative to the current file.
|
186 |
wp_register_style( 'wpa-style', plugins_url( 'css/wpa-style.css', __FILE__ ) );
|
187 |
-
wp_register_style( 'ui-font.css', plugins_url( 'toolbar/fonts/css/a11y-toolbar.css', __FILE__ ) );
|
188 |
-
$toolbar = apply_filters( 'wpa_toolbar_css', plugins_url( 'toolbar/css/a11y.css', __FILE__ ) );
|
189 |
-
wp_register_style( 'ui-a11y.css', $toolbar, array( 'ui-font.css' ) );
|
190 |
-
$fontsize_stylesheet = ( 'on' === get_option( 'wpa_alternate_fontsize' ) ) ? 'a11y-fontsize-alt' : 'a11y-fontsize';
|
191 |
-
$fontsize = apply_filters( 'wpa_fontsize_css', plugins_url( 'toolbar/css/' . $fontsize_stylesheet . '.css', __FILE__ ) );
|
192 |
-
wp_register_style( 'ui-fontsize.css', $fontsize );
|
193 |
-
$toolbar_size = get_option( 'wpa_toolbar_size' );
|
194 |
-
$toolbar_size = ( false === stripos( $toolbar_size, 'em' ) ) ? $toolbar_size . 'px' : $toolbar_size;
|
195 |
-
// Only enable styles when required by options.
|
196 |
-
if ( get_option( 'wpa_toolbar_size' ) && 'on' === get_option( 'wpa_toolbar' ) ) {
|
197 |
-
wp_add_inline_style( 'ui-a11y.css', '.a11y-toolbar ul li button { font-size: ' . $toolbar_size . ' !important; }' );
|
198 |
-
}
|
199 |
if ( 'link' === get_option( 'wpa_longdesc' ) || 'jquery' === get_option( 'wpa_longdesc' ) || 'on' === get_option( 'asl_enable' ) ) {
|
200 |
wp_enqueue_style( 'wpa-style' );
|
201 |
}
|
202 |
-
if ( 'on' === get_option( 'wpa_toolbar' ) || 'on' === get_option( 'wpa_widget_toolbar' ) && ( $toolbar && $fontsize ) ) {
|
203 |
-
wp_enqueue_style( 'ui-a11y.css' );
|
204 |
-
wp_enqueue_style( 'ui-fontsize.css' );
|
205 |
-
}
|
206 |
if ( current_user_can( 'edit_files' ) && 'on' === get_option( 'wpa_diagnostics' ) ) {
|
207 |
wp_register_style( 'diagnostic', plugins_url( 'css/diagnostic.css', __FILE__ ) );
|
208 |
wp_register_style( 'diagnostic-head', plugins_url( 'css/diagnostic-head.css', __FILE__ ) );
|
@@ -676,11 +639,3 @@ function wpa_accessible_theme() {
|
|
676 |
}
|
677 |
return false;
|
678 |
}
|
679 |
-
|
680 |
-
add_action( 'widgets_init', 'wpa_register_toolbar_widget' );
|
681 |
-
/**
|
682 |
-
* Register toolbar widget.
|
683 |
-
*/
|
684 |
-
function wpa_register_toolbar_widget() {
|
685 |
-
register_widget( 'Wp_Accessibility_Toolbar' );
|
686 |
-
}
|
4 |
*
|
5 |
* @package WP Accessibility
|
6 |
* @author Joe Dolson
|
7 |
+
* @copyright 2012-2020 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.7.2
|
21 |
*/
|
22 |
|
23 |
/*
|
38 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
39 |
*/
|
40 |
|
41 |
+
if ( 'on' === get_option( 'wpa_toolbar' ) || 'on' === get_option( 'wpa_widget_toolbar' ) ) {
|
42 |
+
require_once( dirname( __FILE__ ) . '/wp-accessibility-toolbar.php' );
|
43 |
+
}
|
44 |
require_once( dirname( __FILE__ ) . '/wp-accessibility-longdesc.php' );
|
45 |
require_once( dirname( __FILE__ ) . '/wp-accessibility-alt.php' );
|
46 |
require_once( dirname( __FILE__ ) . '/wp-accessibility-contrast.php' );
|
69 |
* Install on activation.
|
70 |
*/
|
71 |
function wpa_install() {
|
72 |
+
$wpa_version = '1.7.2';
|
73 |
if ( 'true' !== get_option( 'wpa_installed' ) ) {
|
74 |
add_option( 'rta_from_nav_menu', 'on' );
|
75 |
add_option( 'rta_from_page_lists', 'on' );
|
121 |
return $links;
|
122 |
}
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
add_action( 'wp_enqueue_scripts', 'wpacc_enqueue_scripts' );
|
125 |
/**
|
126 |
* Enqueue accessibility scripts dependent on options.
|
127 |
*/
|
128 |
function wpacc_enqueue_scripts() {
|
129 |
wp_enqueue_script( 'jquery' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
if ( 'on' === get_option( 'wpa_insert_roles' ) ) {
|
131 |
wp_enqueue_script( 'wpa-complementary', plugins_url( 'js/roles.jquery.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
132 |
if ( get_option( 'wpa_complementary_container' ) ) {
|
163 |
function wpa_stylesheet() {
|
164 |
// Respects SSL, Style.css is relative to the current file.
|
165 |
wp_register_style( 'wpa-style', plugins_url( 'css/wpa-style.css', __FILE__ ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
if ( 'link' === get_option( 'wpa_longdesc' ) || 'jquery' === get_option( 'wpa_longdesc' ) || 'on' === get_option( 'asl_enable' ) ) {
|
167 |
wp_enqueue_style( 'wpa-style' );
|
168 |
}
|
|
|
|
|
|
|
|
|
169 |
if ( current_user_can( 'edit_files' ) && 'on' === get_option( 'wpa_diagnostics' ) ) {
|
170 |
wp_register_style( 'diagnostic', plugins_url( 'css/diagnostic.css', __FILE__ ) );
|
171 |
wp_register_style( 'diagnostic-head', plugins_url( 'css/diagnostic-head.css', __FILE__ ) );
|
639 |
}
|
640 |
return false;
|
641 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|