如何在我的wp插件管理页面中捕获和提交转发器字段的值

I am writing a new wp plugin and want to capture and submit values of a repeater filed in its admin page, I don't want and can't use ACF pro others so I have set the repeater field up with javascript. Using the switch for different input types, capturing the values of a repeater fields in an array has made things a little bit complicated. Can you please review my code and let me know how I need to pass the values? Thanks.

public function setup_fields() {
$td_settings = array(
    array(
                    'uid' => 'TD_repeater_field',
            'label' => 'Treasure Data Events',
            'section' => 'TD_integration_section',
            'type' => 'repeater',
            'default' => array(

           )  
    );
foreach( $td_settings as $td_setting ){
    add_settings_field( $td_setting['uid'], $td_setting['label'], 
    array( $this, 'field_callback' ), 'td_fields', 
    $td_setting['section'], $td_setting );
register_setting( 'td_fields', $td_setting['uid'] );

     }     

);

public function field_callback( $arguments ) {
    $value = get_option( $arguments['uid'] );
    if( ! $value ) {
        $value = $arguments['default'];
    }
    switch( $arguments['type'] ){
    case 'repeater':
$row = '';
foreach( $arguments['type'] as $key => $label ){
$row .= sprintf( '<input type="text" name="td-method"  
    value="%s" /><input type="text" name="td-prop"  value= "%s"/>', 
    $key, ( $value[ array( $key, $value, true ) ] ), $label );
}

printf('<div id="repeater">
<div data-repeater-list="category-group">
     <div data-repeater-item id="%1$s">
     <input type="hidden" name="id" id="cat-id"/>
     %2$s
      <input data-repeater-delete type="button" value="Delete"/>
      </div>
      </div>
       <input data-repeater-create type="button" value="Add"/>
   </div>', $arguments['uid'], $row);

 break;
}

}