Automattic\WooCommerce\Internal\Admin\ProductForm
FormFactory::get_items
Returns list of registered items.
Метод класса: FormFactory{}
Хуков нет.
Возвращает
Массив. list of registered items.
Использование
$result = FormFactory::get_items( $type, $class_name, $sort_by, foooo, ) );
- $type(строка) (обязательный)
- Form component type.
- $class_name(class-string) (обязательный)
- Class of component type.
- $sort_by(массив)
- key and order to sort by.
По умолчанию: array( foo - foooo
- .
По умолчанию: > fooooo - )(обязательный)
- .
Код FormFactory::get_items() FormFactory::get items WC 10.3.4
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;
}