(function(api) { api.sectionConstructor['abyssal-upsell'] = api.Section.extend({ attachEvents: function() {}, isContextuallyActive: function() { return true; } }); const abyssal_section_lists = ['Main', 'Clients', 'Logo']; abyssal_section_lists.forEach(abyssal_homepage_scroll); function abyssal_homepage_scroll(item) { item = item.replace(/-/g, '_'); wp.customize.section('abyssal_' + item + '_section', function(section) { section.expanded.bind(function(isExpanding) { wp.customize.previewer.send(item, { expanded: isExpanding }); }); }); } })(wp.customize);