|
2 | 2 | /** |
3 | 3 | * Plugin Name: A11y Add-on for FacetWP |
4 | 4 | * Plugin URI: https://github.com/devcollaborative/A11y-Add-on-for-FacetWP |
5 | | - * Description: Adds better a11y support to FacetWP plugin |
| 5 | + * Description: Adds better a11y support to FacetWP plugin. Disable FacetWP's native "Load a11y support" |
6 | 6 | * Version: 1.0 |
7 | 7 | * Requires at least: 6.4 |
8 | 8 | * Requires PHP: 8 |
@@ -54,6 +54,7 @@ function a11y_addon_facet_assets() { |
54 | 54 | * @link https://facetwp.com/documentation/developers/output/facetwp_facet_html/ |
55 | 55 | */ |
56 | 56 | function a11y_addon_add_facet_class( $output, $params ){ |
| 57 | + |
57 | 58 | if ( 'dropdown' == $params['facet']['type'] ) { |
58 | 59 | $output = str_replace( 'facetwp-dropdown', 'facetwp-dropdown a11y-addon-filter', $output ); |
59 | 60 | } |
@@ -203,8 +204,6 @@ function remove_underscores( name ) { |
203 | 204 | var facet_name = $facet.attr('data-name'); |
204 | 205 | var facet_type = $facet.attr('data-type'); |
205 | 206 |
|
206 | | - console.log(facet_name); |
207 | | - |
208 | 207 | if ( facet_name && facet_type ) { |
209 | 208 | // Don't label the pagination or reset |
210 | 209 | if ( facet_name.match(/pagination/g) || |
@@ -265,7 +264,7 @@ function a11y_addon_disable_auto_refresh() { |
265 | 264 | add_action( 'facetwp_scripts', 'a11y_addon_disable_auto_refresh', 100 ); |
266 | 265 |
|
267 | 266 | // Customize icon for prev/next pagination links. |
268 | | -function fwp_facetwp_facet_pager_link($html, $params) { |
| 267 | +function a11y_addon_facetwp_facet_pager_link($html, $params) { |
269 | 268 | if ( 'next' == $params['extra_class'] ) { |
270 | 269 | $icon = 'Next <svg class="icon" aria-hidden="true"><use xlink:href="#caret-right"/></svg></svg>'; |
271 | 270 | $html = str_replace( 'Next', $icon, $html ); |
|
0 commit comments