我正在尝试更改显示在付款方式旁边的图标。为此,我跟踪了支付网关插件从何处获取图标,并且我发现此类具有分配给 $this->icon 的 url:
class WC_Gateway_Rapyd_Card extends WC_Rapyd_Payment_Gateway {
public function __construct() {
$this->id = RAPYD_CARD_ID;
$this->title = RAPYD_CARD_TITLE;
$this->method_title = RAPYD_CARD_METHOD_TITLE;
$this->description = RAPYD_CARD_DESCRIPTION;
/* translators: link */
$this->method_description = RAPYD_CARD_METHOD_DESCRIPTION;
$this->has_fields = true;
$this->icon = 'https://cdn.rapyd.net/plugins/icons/card_icon.png';
$this->constructor_helper();
}
public function getCategory() {
return RAPYD_CATEGORY_CARD;
}
}
要更改图标,我可以用自己的网址更新当前网址,但这样做可能意味着每次更新插件时我都必须这样做。
是否可以/建议从functions.php 将url 分配给该类中的$this->icon?