$source) { $accordion_content_title = isset($source["accordion_content_title"]) ? $source["accordion_content_title"] : ""; $accordion_content_description = isset($source["accordion_content_description"]) ? $source["accordion_content_description"] : ""; $headerLabelText = $accordion_content_title; $headerLabelToggledText = strtolower(str_replace(' ', '-', $accordion_content_title));; $headerLabelSlug = isset($item["headerLabelSlug"]) ? $item["headerLabelSlug"] : ""; $contentText = $accordion_content_description; $items[$index] = [ "active" => 0, "headerLabelText" => $headerLabelText, "headerLabelToggledText" => $headerLabelToggledText, "headerLabelSlug" => $headerLabelSlug, "contentText" => $contentText, ]; } return $items; }