开发者 | Brad Davis |
---|---|
更新时间 | 2022年2月15日 11:54 |
PHP版本: | 4.0 及以上 |
WordPress版本: | 5.9.0 |
版权: | GPLv3 or later |
版权网址: | 版权信息 |
/wp-content/plugins/
directoryThis can be done using the built in WordPress add filter function. For example, if we had a product with an id of 96 and we wanted to change the text of the "Product Price Text" field to "Your new Product Price Text, the function would like this:
function change_before_regular_price( $woo_rrp_before_price ) { global $post; if ( '96' == $post->ID ) : return 'Your new Product Price Text'; else : return $woo_rrp_before_price; endif; } add_filter( 'woo_rrp_before_price', 'change_before_regular_price' );
This can be done using the built in WordPress add filter function. For example, if we had a product with an id of 96 and we wanted to change the text of the "Sale Price Text" field to "Your new Sale Price Text, the function would like this:
function change_before_sale_price( $woo_rrp_before_sale_price ) { global $post; if ( '96' == $post->ID ) : return 'Your new Sale Price Text'; else : return $woo_rrp_before_sale_price; endif; } add_filter( 'woo_rrp_before_sale_price', 'change_before_sale_price' );
Sure, there are two filters available for you to use:
You will need to tidy this up using a little CSS styling.