Advertisement
wclovers

Untitled

Feb 23rd, 2023
826
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. function cf_replace_texts( $translation, $text, $domain ) {
  2.     $allowed_domains = [
  3.         'wc-multivendor-marketplace',
  4.     ];
  5.  
  6.     if( in_array( $domain, $allowed_domains ) ) {
  7.         $find = ['Available for shopping more than <b>%s%d</b>.'];
  8.         $replace = ['Available for a purchase of <b>%s%d</b> or more.'];
  9.         $translation = str_ireplace( $find, $replace, $translation );
  10.     }
  11.  
  12.     return $translation;
  13. }
  14. add_filter('gettext', 'cf_replace_texts', 10, 3);
  15. add_filter('ngettext', 'cf_replace_texts', 10, 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement