I received several requests to add features to my ACSS variable and class listing, and while coding these is sort of fun, I decided to opt for a more robust…
I received several requests to add features to my ACSS variable and class listing, and while coding these is sort of fun, I decided to opt for a more robust solution with wpDataTable. Overall performance is faster than for the large JSON query (960+ for ACSS 4 and 3200+ for ACSS 3), and several new options are available (sorting, filtering, and downloading). One gotcha I ran into was that wpDatatable kept rendering variable names with an en dash instead of the –. Initially, I thought it was the native WP texturizer, but it turned out to be wpDataTables’ table rendering. The support team couldn’t help, so I turned to ChatGPT. After several tests to identify the root cause, I resolved the issue using JavaScript. It takes an array of table IDs (see code below). The other problem I encountered was the download. The CSV version doesn’t work in Excel because the – and * are treated as math operators, and Excel tries to create functions. Switching to the Excel download resolved the issue.
document.addEventListener('DOMContentLoaded', () => );
document.addEventListener('DOMContentLoaded', () => );
JavaScript
Leave a Reply