Skip to content

Instantly share code, notes, and snippets.

View amberhinds's full-sized avatar

Amber Hinds amberhinds

View GitHub Profile
@amberhinds
amberhinds / functions.php
Created April 11, 2024 17:49
How to remove a specific rule from Accessibility Checker Scans
function my_rule_filter($rules){
$rules = edac_remove_element_with_value($rules, 'slug', 'slider_present'); // Replace the slug with the slug of the rule you want to remove.
return $rules;
}
add_filter('edac_filter_register_rules','my_rule_filter');
@amberhinds
amberhinds / functions.php
Created April 11, 2024 17:53
How to remove all rules of type from Accessibility Checker
function my_rule_type_filter($rules){
$rules = edac_remove_element_with_value($rules, 'rule_type', 'warning'); // Removes all warnings
return $rules;
}
add_filter('edac_filter_register_rules','my_rule_type_filter');
@amberhinds
amberhinds / functions.php
Created April 12, 2024 14:47
Remove posts in category from blog archive
/** Remove shorts category from the blog **/
add_filter( 'pre_get_posts', 'amber_exclude_shorts_category' );
function amber_exclude_shorts_category ( $query ) {
if ( $query->is_home && ! is_admin() ) {
$query->set( 'cat', '-272' );
}
return $query;
}
@amberhinds
amberhinds / style.css
Created June 26, 2024 15:41
Position Elementor Slides Pause Button Bottom Right
selector #pause-button-0 {
position: absolute;
bottom:5px;
right: 5px;
z-index: 999;
}
@amberhinds
amberhinds / FixEDDReturnKeyOnCheckout.JS
Created August 26, 2024 21:46
Code that restores the ability for keyboard only users to trigger links and buttons on EDD checkout pages when using the Payment Elements experience.
/**
* Fix broken return key on checkout page.
*
* THIS IS A TEMPORARY FIX TILL EDD FIXES THE ISSUE.
*
* Edd has a stripe script that binds to the entire document and runs
* preventDefault on the return key. This is a temporary fix to allow
* the return key to work on the checkout page.
*/
export const checkoutFixBrokenReturnKey = () => {
@amberhinds
amberhinds / footer.js
Last active January 29, 2025 03:28
Add Main tag with correct ID if missing to fix broken skip links in Elementor
@amberhinds
amberhinds / footer.js
Created February 28, 2025 19:39
Fix Max Mega Menu toggle buttons to have a true button adjacent to the link
@amberhinds
amberhinds / footer.js
Created April 2, 2025 21:30
Add a span with aria-current to breadcrumb current page.
@amberhinds
amberhinds / fix-plugin-header-level.js
Created April 10, 2025 16:48
Change a H5 with a specific ID to an H2 instead
// Get the <h5> element with the ID #plugin-block-heading1
const h5Element = document.getElementById('plugin-block-heading1');
if (h5Element) {
// Create a new <h2> element
const h2 = document.createElement('h2');
// Copy the content of the <h5> to the <h2>
h2.innerHTML = h5Element.innerHTML;
@amberhinds
amberhinds / example-composite-products-tabs.html
Created July 15, 2025 19:49
Example improved tab HTML for Woo composite products
<div class="component_selections">
<p class="component_section_title">
<label class="select_label" for="component_options_1749463717">
Available options:
</label>
</p>
<div class="component_pagination cp_clearfix top" data-pagination_data="{&quot;page&quot;:1,&quot;pages&quot;:1}" style="display:none">
<p class="index woocommerce-result-count" tabindex="-1">Page 1 of 1</p>
<nav class="woocommerce-pagination">
<ul class="page-numbers">