Skip to content

Instantly share code, notes, and snippets.

@thesmart
Last active November 15, 2024 00:17
Show Gist options
  • Select an option

  • Save thesmart/40c40f26fc9179c0ab4ac7f36d13d209 to your computer and use it in GitHub Desktop.

Select an option

Save thesmart/40c40f26fc9179c0ab4ac7f36d13d209 to your computer and use it in GitHub Desktop.

Revisions

  1. thesmart revised this gist Nov 15, 2024. 1 changed file with 3 additions and 6 deletions.
    9 changes: 3 additions & 6 deletions wordpress-accordion-open-all.js
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,6 @@ const contentWrappers = document.querySelectorAll('.wp-block-getwid-accordion__c
    contentWrappers.forEach((wrapper) => {
    wrapper.style.display = 'block';
    wrapper.style.height = 'auto';
    const contentEl = wrapper.querySelector('.ui-accordion-content');
    if (contentEl) {
    contentEl.style.display = 'block';
    contentEl.style.height = 'auto';
    }
    });
    wrapper.ariaHidden = undefined;
    wrapper.inert = false;
    });
  2. thesmart created this gist Nov 15, 2024.
    11 changes: 11 additions & 0 deletions wordpress-accordion-open-all.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    const contentWrappers = document.querySelectorAll('.wp-block-getwid-accordion__content-wrapper');

    contentWrappers.forEach((wrapper) => {
    wrapper.style.display = 'block';
    wrapper.style.height = 'auto';
    const contentEl = wrapper.querySelector('.ui-accordion-content');
    if (contentEl) {
    contentEl.style.display = 'block';
    contentEl.style.height = 'auto';
    }
    });