michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
337 stars 71 forks source link

Type inline_mixed not working/displaying #257

Closed sudheer-ranga closed 7 years ago

sudheer-ranga commented 7 years ago

Here is my code. For some reason the inline_mixed isn't working or displaying as expected.

$this->addSettingSections(
      'my_page_slug',

      array(
        'section_id'  => 'section_id',
        'tab_slug'    => 'tab_slug',
        'title'       => 'Forms',
        'repeatable'    => array(
          'max' => 2,
        ),
        'collapsible'       => array(
          'toggle_all_button' => array( 'top-left', 'bottom-left' ),
          'container'         => 'section',
        ),
    )
);

I added the fields as below.

$this->apf->addSettingFields(
  'section_id',

  array(  // Form Title
    'field_id'      => 'field_id_text',
    'type'          => 'text',
    'title'         => 'Form ID',
    'attributes'    => array(
      'readonly'  =>  'ReadOnly',
    )
  ),
  array(
    'field_id'      => 'checkbox_number_select',
    'type'          => 'inline_mixed',
    'repeatable'    => true,
    'title'         => __( 'Checkbox, Number & Select', 'admin-page-framework-loader' ),
    'content'       => array(
      array(
        'field_id'        => 'enable',
        'type'            => 'checkbox',
        'label_min_width' => '',
        'label'           => __( 'Do something in', 'admin-page-framework-loader' ),
      ),
      array(
        'field_id'        => 'interval',
        'type'            => 'number',
        'label_min_width' => '',
        'default'         => 3,
        'attributes'      => array(
          'style'     => 'width: 80px',
        ),
      ),
      array(
        'field_id'        => 'interval_unit',
        'type'            => 'select',
        'label_min_width' => '',
        'label'           => array(
          'hour'    => __( 'hours', 'admin-page-framework-loader' ),
          'day'     => __( 'days', 'admin-page-framework-loader' ),
          'week'    => __( 'weeks', 'admin-page-framework-loader' ),
        ),
        'default'         => 'day',
      ),
      array(
        'field_id'      => '_text',
        'content'       => __( 'to do something else.', 'admin-page-framework-loader' ),
      ),
    ),
  )
);

Here is how it displays.

screen shot 2016-08-01 at 9 31 03 pm

What am I doing wrong.

sudheer-ranga commented 7 years ago

@michaeluno My bad :P I was on v3.7.15. I updated to v3.8 and this one seems to work fine.