<?php
$accordion = array (
  'key' => 'accordion',
  'label' => 'Accordion',
  'name' => 'accordion-block', //defines the Twig file you're using
  'type' => 'repeater',
  'sub_fields' => array (
    array (
      'key' => 'accordion__Title',
      'label' => 'Section Title',
      'name' => 'title',
      'type' => 'text',
    ),
    array (
      'key' => 'accordion_actually_section_label',
      'label' => 'Section Label',
      'name' => 'blocklabel',
      'type' => 'text',
      'instructions' => __('This label appears in in-page navigation and within the content of some blocks, overriding the title.', 'ipsen-master'),
    ),
    array(
      'key' => 'hide_block',
      'label' => 'Hide this block from anchor links',
      'name' => 'hide_block',
      'type' => 'true_false',
      'instructions' => '',
      'required' => 0,
      'wrapper' => array(
        'width' => '',
        'class' => '',
        'id' => '',
      ),
      'message' => '',
      'default_value' => 0,
      'ui' => 1,
      'ui_on_text' => '',
      'ui_off_text' => '',
    ),
    array(
      'key' => 'accordion_intro', 
      'label' => 'Intro',
      'name' => 'intro',
      'type' => 'wysiwyg',
      'tabs' => 'visual',
      'media_upload' => 1,
      'instructions' => '',
      'required' => 0,
      'conditional_logic' => 0,
    ),
    array(
      'key' => 'accordion__Accordions',
      'label' => 'Accordions',
      'name' => 'accordions', // has to match the variable in the Twig file.
      'layout' => 'block',
      'type' => 'repeater',
      'button_label' => 'Add Accordion',
      'sub_fields' => array (
        array(
          'key' => 'accordionHeader', 
          'label' => 'Heading',
          'name' => 'accordionHeader',
          'type' => 'text',
          'instructions' => '',
          'required' => 0,
          'conditional_logic' => 0,
          'wrapper' => array(
            'width' => '',
            'class' => '',
            'id' => '',
          ),
          'default_value' => '',
          'placeholder' => '',
          'prepend' => '',
          'append' => '',
          'maxlength' => '',
        ),
        array(
          'key' => 'accordionContent', 
          'label' => 'Content',
          'name' => 'accordionContent',
          'type' => 'wysiwyg',
          'tabs' => 'visual',
          'media_upload' => 1,
          'instructions' => '',
          'required' => 0,
          'conditional_logic' => 0,
        ),
      ),
    ),
  ),

'parent' => 'contentblocks_flex', //flex field key
'parent_layout' => '56ff5b1a77c76', // layout key
'row_min' => 0,
'row_limit' => '',
'layout' => 'row',
);

array_push($_SESSION["blocks"], $accordion);  