Automattic\WooCommerce\Internal\Admin\ProductForm
FormFactory::add_section
Adds a section to the product form.
Method of the class: FormFactory{}
No Hooks.
Returns
Section|WP_Error. New section or WP_Error.
Usage
$result = FormFactory::add_section( $id, $plugin_id, $args );
- $id(string) (required)
- Card id.
- $plugin_id(string) (required)
- Plugin id.
- $args(array) (required)
- Array containing the necessary arguments.
FormFactory::add_section() FormFactory::add section code WC 10.8.1
public static function add_section( $id, $plugin_id, $args ) {
$new_section = self::create_item( 'section', 'Section', $id, $plugin_id, $args );
if ( is_wp_error( $new_section ) ) {
return $new_section;
}
self::$form_sections[ $id ] = $new_section;
return $new_section;
}