This prunes stores and configurations that are empty arrays, as stores are expected to be JSON objects.
By not printing empty configurations, less redundant data is serialized into the HTML.
Reviewed by gziolo.
Merges [57841] to the to the 6.5 branch.
Props jonsurrell, luisherranz, darerodz, gziolo, swissspidy.
Fixes#60761.
Built from https://develop.svn.wordpress.org/branches/6.5@57843
git-svn-id: http://core.svn.wordpress.org/branches/6.5@57344 1a063a9b-81f0-0310-95a4-ce76da25c4cd