Automattic\WooCommerce\Internal\Abilities\Domain
ProductCreate::can_create_product
Check product creation access.
Метод класса: ProductCreate{}
Хуков нет.
Возвращает
bool.
Использование
$result = ProductCreate::can_create_product( $input ): bool;
- $input(разное)
- Ability input.
По умолчанию:array()
Список изменений
| С версии 10.9.0 | Введена. |
Код ProductCreate::can_create_product() ProductCreate::can create product WC 11.3.0
public static function can_create_product( $input = array() ): bool {
// Cap is not object-scoped for create.
unset( $input );
return wc_rest_check_post_permissions( 'product', 'create' );
}