我想更改我在WooCommerce中看到的错误消息的措辞。
是否有任何过滤器可用于执行此操作?
我想更改我在WooCommerce中看到的错误消息的措辞。
是否有任何过滤器可用于执行此操作?
您可以使用woocommerce_add_error
滤器将以下内容添加到函数中。php文件。
// alter the subscriptions error
function my_woocommerce_add_error( $error ) {
if( \'The generic error message\' == $error ) {
$error = \'The shiny brand new error message\';
}
return $error;
}
add_filter( \'woocommerce_add_error\', \'my_woocommerce_add_error\' );
对于我的众多网站之一,plugins/plugin-name 是指向的符号链接universal-install/wp-content/plugins/plugin-name.echo WP_PLUGIN_URL 显示我期望的内容echo plugins_url(); 显示我期望的内容echo plugins_url(\'\',__FILE__) 显示我期望的内容,后跟指向通用插件目录的绝对路径。我有什么办法可以解决吗echo plugins_url(\'\',__FILE__) 仅返回预期结果?