Legacy note: this chapter applies only to old PHP theme files from the legacy rendering model. New 3.x calculators use the modern frontend and do not need this API for normal theme customization.
If you still maintain a legacy PHP theme, field data is exposed through the $this->view['fields'] structure.
<?php echo $this->view['fields']['aws_price_calc_1']['id']; echo $this->view['fields']['aws_price_calc_1']['label_id']; echo $this->view['fields']['aws_price_calc_1']['label_name']; echo $this->view['fields']['aws_price_calc_1']['field_id']; echo $this->view['fields']['aws_price_calc_1']['type']; echo $this->view['fields']['aws_price_calc_1']['class']; echo $this->view['fields']['aws_price_calc_1']['html']; echo $this->view['fields']['aws_price_calc_1']['value']; ?>
Main properties:
- id: numeric field ID
- label_id: unique label element ID
- label_name: translated label text
- field_id: HTML field ID
- type: field type
- class: CSS class applied to the field
- html: rendered HTML for the field widget
- value: current field value
Example of rendering a legacy field widget:
<?php echo $this->view['fields']['aws_price_calc_1']['html']; ?>
For new 3.x projects, do not start from this legacy API. Use the modern theme options, Preview, scoped CSS, or WordPress hooks instead.