Automattic\WooCommerce\Internal\Admin\ProductForm
FormFactory::get_items
Returns list of registered items.
Method of the class: FormFactory{}
No Hooks.
Returns
Array. list of registered items.
Usage
$result = FormFactory::get_items( $type, $class_name, $sort_by, foooo, ) );
- $type(string) (required)
- Form component type.
- $class_name(class-string) (required)
- Class of component type.
- $sort_by(array)
- key and order to sort by.
Default:array( foo - foooo
- .
Default:> fooooo - )(required)
- .
FormFactory::get_items() FormFactory::get items code WC 10.6.2
private static function get_items( $type, $class_name, $sort_by = array(
'key' => 'order',
'order' => 'asc',
) ) {
$item_list = self::get_item_list( $type );
$class = 'Automattic\\WooCommerce\\Internal\\Admin\\ProductForm\\' . $class_name;
$items = array_values( $item_list );
if ( class_exists( $class ) && method_exists( $class, 'sort' ) ) {
usort(
$items,
function ( $a, $b ) use ( $sort_by, $class ) {
return $class::sort( $a, $b, $sort_by );
}
);
}
return $items;
}