Kevan, please correct me if I’m wrong, but the problem seems to be simply that the accordion code unlike the other examples on your demo page doesn’t retrieve the value from the regex routine that converts the id to lowercase and changes spaces to underscores. This is the div element from the Tables tab of the Tabs demo:
<div id=”tables” class=”ui-tabs-panel ui-widget-content ui-corner-bottom” aria-labelledby=”ui-id-3″ role=”tabpanel” style=”display: block;” aria-expanded=”true” aria-hidden=”false”>
This is the h3 element from the Lorem tab of the Accordion demo:
<h3 id=”Lorem” class=”wp-tab-title ui-accordion-header ui-helper-reset ui-state-default ui-accordion-header-active ui-state-active ui-corner-top ui-accordion-icons” role=”tab” aria-controls=”ui-accordion-1-panel-0″ aria-selected=”true” tabindex=”0″>
Clearly, the id=”Lorem” value should be id=”lorem”, which is why the link fails. As you can see, the link to the Lorem tab is lowercase, as it should be:
https://kav.in/projects/blog/linking-to-tabs-accordions-and-spoilers-in-wp-ui/#lorem
I can confirm that, on my site, the id of the linked-to element is generated with uppercase chars and spaces:
<h3 id=”Charles Dickerson” class=”wp-tab-title ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-accordion-icons” role=”tab” aria-controls=”ui-accordion-1-panel-14″ aria-selected=”false” tabindex=”-1″>
Kevan, this should be an easy fix since you know this code inside and out. Could you please, pretty please, address this and repost to GitHub? I think many people would really appreciate it and return to this plugin from the alternatives they’ve been forced to use just because this essential functionality doesn’t work, apparently due to what’s may be simply a typo in the code.
Again, many thanks for this plugin which most would agree is a huge achievement aside for this one issue.
Van aka motorhobo