WC_Payment_Gateway::supports()
Check if a gateway supports a given feature.
Gateways should override this to declare support (or lack of support) for a feature. For backward compatibility, gateways support 'products' by default, but nothing else.
Метод класса: WC_Payment_Gateway{}
Хуки из метода
Возвращает
true|false
. True if the gateway supports the feature, false otherwise.
Использование
$WC_Payment_Gateway = new WC_Payment_Gateway(); $WC_Payment_Gateway->supports( $feature );
- $feature(строка) (обязательный)
- string The name of a feature to test support for.
Список изменений
С версии 1.5.7 | Введена. |
Код WC_Payment_Gateway::supports() WC Payment Gateway::supports WC 9.3.3
public function supports( $feature ) { /** * Filter the gateway supported features. * * @since 1.5.7 * @param boolean $supports If the gateway supports the feature. * @param string $feature Feature to check. * @param WC_Payment_Gateway $this Payment gateway instance. * @return string */ return apply_filters( 'woocommerce_payment_gateway_supports', in_array( $feature, $this->supports, true ), $feature, $this ); }