Automattic\WooCommerce\Enums
ProductStatus::get_all
Returns every product status value defined by this enum, as a flat list.
A product can hold any of them: WC_Product::set_status() does not validate, and core assigns self::AUTO_DRAFT and self::TRASH itself. What separates them is who decides. WordPress sets self::AUTO_DRAFT, self::TRASH and self::FUTURE; an author chooses the rest.
WooCommerce has no narrower helper, and get_post_statuses() is not one: it is unfiltered and lists only draft, pending, private and publish. Narrow this list yourself for a particular editor or REST schema.
Метод класса: ProductStatus{}
Хуков нет.
Возвращает
string[].
Использование
$result = ProductStatus::get_all(): array;
Список изменений
| С версии 10.9.0 | Введена. |
Код ProductStatus::get_all() ProductStatus::get all WC 11.2.2
public static function get_all(): array {
return array(
self::AUTO_DRAFT,
self::DRAFT,
self::PENDING,
self::PRIVATE,
self::PUBLISH,
self::TRASH,
self::FUTURE,
);
}