button_label ) ) { $this->button_label = __( 'Add new row', 'Kirki' ); } if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) { $args['fields'] = array(); } foreach ( $args['fields'] as $key => $value ) { if ( ! isset( $value['default'] ) ) { $args['fields'][ $key ]['default'] = ''; } if ( ! isset( $value['label'] ) ) { $args['fields'][ $key ]['label'] = ''; } $args['fields'][ $key ]['id'] = $key; } $this->fields = $args['fields']; } public function to_json() { parent::to_json(); $this->json['fields'] = $this->fields; $this->json['value'] = $this->value(); } public function enqueue() { wp_enqueue_script( 'kirki-repeater', trailingslashit( kirki_url() ) . 'includes/controls/repeater/script.js', array( 'jquery', 'customize-base' ), '', true ); wp_enqueue_script( 'jquery-ui-core' ); wp_enqueue_script( 'jquery-ui-sortable' ); } public function render_content() { $value = json_encode( $this->value() ); $id = $this->id; ?> repeater_js_template(); } public function repeater_js_template() { ?>