Below is the optimized code. I decided to take a look at what I wrote and tested a couple of scenarios.
The accordion id syntax used by Squarespace for my pages is "button-block-yui-<some id>-0" for the first item, "button-block-yui-<some id>-1" for the second, etc.
If you want to create a link to open a specific accordion item, you'll use:
https://yoursite.com/page#<button-block-yui-dropdownNumber>, where the value of dropdownNumber is 0, 1, 2, 3, ..., depending on which item in the list you want to open.
Here's the optimized code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
<!-- Save the window location hash passed to this page -->
var loc = window.location.hash;
<!-- If a hash exists, and there's a matching element in the page -->
if (loc.length && $(loc).length){
<!-- Execute the click event on the matching element -->
$(loc).click();
}
});
</script>
Support said they opened a case for this. Given we're not privy to any bug tracking numbers to correlate our cases to actual fixes, I don't even believe a case was even opened. It seems the standard response is along the lines of "we notified engineering, but we can't tell you if/when it will be fixed."
I won't be opening any more support cases, and I will move off Squarespace when our subscription comes up for renewal. I think it's a waste of time trying to help.