dongmangsha7354 2016-10-26 13:49
浏览 57

如何更改“WooCommerce Product Add-ons”插件中的“选择选项”文本

i'm using the woocommerce product Add-ons plugin and i want to change the default value that appears on dropdowns that says 'select an option':

enter image description here

I managed to find all other english texts in the plugins editor and changed them but this single line is bugging me because i can't seem to find where it is initialized.

EDIT

This is the exact plugin i'm using:

Woocommerce product Add-Ons

Any help would be much appreciated!

  • 写回答

1条回答 默认 最新

  • dongqiang1894 2016-10-26 14:41
    关注

    The quickest way would be to add a line on your functions.php child theme where you can change text:

    add_filter( 'gettext', 'customizing_product_variation_message', 10, 3 );
    function customizing_product_variation_message( $translated_text, $untranslated_text, $domain )
    {
    if ($untranslated_text == 'Select an option...') {
        $translated_text = __( 'ENTER HERE THE NEW TEXT', $domain );
    }
    return $translated_text;
    }
    

    Bear in mind that you might need to remove the ... at the end of the "Select an option" text.

    Hope that helps

    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数