wordpress - 在插件功能中更改图像
问题描述
我想更改此插件中的图像,这样我就不必在每次更新时都覆盖它。有什么简单的方法可以做到这一点吗?这是我所指的功能。我将不得不更改'/images/delivery.svg'
图像的路径。谢谢!
public function show_picked_up_icon( $order, $css_class = '' ) {
if ( ! $this->is_order_shipped( $order ) ) {
return;
}
$order_id = yit_get_prop( $order, 'id' );
$track_css_class = "button track-button order-" . $order_id;
if ( ! empty( $css_class ) ) {
$track_css_class .= " " . $css_class;
}
$message = $this->get_picked_up_message( $order );
$track_url = $this->get_track_url( $order );
if ( strlen( $track_url ) == 0 ) {
$message = __( "Track url not found.", 'yith-woocommerce-order-tracking' ) . $message;
$track_url = '#';
}
echo '<a class="' . $track_css_class . '" href="' . $track_url . '" target="_blank" data-title="' . $message . '">';
echo '<img class="track-icon track-button" src="' . apply_filters( 'yith_ywot_track_button_url', YITH_YWOT_ASSETS_URL . '/images/delivery.svg' ) . '" data-title="' . $message . '" />';
if ( ! is_admin() ) {
_e( 'Track', 'yith-woocommerce-order-tracking' );
}
echo '</a>';
// If the carrier website use a form to track shipment, add a hidden form under the button
$track_form = $this->get_tracking_post_form( $order );
$data = YITH_Tracking_Data::get( $order );
if ( ! empty( $track_form ) ) {
// Append a form to be used for post data to carrier web site
?>
<script type="text/javascript">
jQuery(document).on("click", "a.track-button.order-<?php echo $order_id; ?>", (function (e) {
e.preventDefault();
jQuery("body").append('<?php echo str_replace( "\n", "\\", $track_form ); ?>');
jQuery("form[name='<?php echo $data->get_carrier_id(); ?>']").submit();
jQuery("form[name='<?php echo $data->get_carrier_id(); ?>']").remove();
}));
</script>
<?php
}
}
解决方案
推荐阅读
- google-cloud-platform - GCP 云部署负载均衡器后端存储桶
- python - 如何允许我的计算机从电子邮件中下载 .py 文件
- clang - 使用 Clang/Ninja 产生所有可能的错误 / 继续使用 Ninja / Ninja 相当于 make -k
- linq - LINQ 通过选择新加入组
- sshd - sshd 按地址和 IP 限制组
- ios - iOS:通用链接仅适用于 Safari
- php - 使用简码添加产品时,Woocommerce 变体订阅未显示在购物篮中
- android - 将 YouTubePlayerSupportFragment 片段添加到片段事务时类型不匹配
- c# - 在网站上创建文本并检索它?C#
- css - 如何使引导徽章的颜色略有不同?