Automattic\WooCommerce\Admin\API
ProductForm::get_form_config
Get the form config.
Метод класса: ProductForm{}
Хуков нет.
Возвращает
WP_REST_Response|WP_Error.
Использование
$ProductForm = new ProductForm(); $ProductForm->get_form_config( $request );
- $request(WP_REST_Request) (обязательный)
- Full details about the request.
Код ProductForm::get_form_config() ProductForm::get form config WC 10.9.4
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,
)
);
}