Automattic\WooCommerce\Admin\API
ProductForm::get_form_config
Get the form config.
Method of the class: ProductForm{}
No Hooks.
Returns
WP_REST_Response|WP_Error.
Usage
$ProductForm = new ProductForm(); $ProductForm->get_form_config( $request );
- $request(WP_REST_Request) (required)
- Full details about the request.
ProductForm::get_form_config() ProductForm::get form config code WC 10.8.1
public function get_form_config( $request ) {
$fields = array_map(
function( $field ) {
return $field->get_json();
},
FormFactory::get_fields()
);
$subsections = array_map(
function( $subsection ) {
return $subsection->get_json();
},
FormFactory::get_subsections()
);
$sections = array_map(
function( $section ) {
return $section->get_json();
},
FormFactory::get_sections()
);
$tabs = array_map(
function( $tab ) {
return $tab->get_json();
},
FormFactory::get_tabs()
);
return rest_ensure_response(
array(
'fields' => $fields,
'subsections' => $subsections,
'sections' => $sections,
'tabs' => $tabs,
)
);
}