פונקצייה מעולה לשינויי תוכן / טקסט/ סטרינגים בעיקר
- שינויי כפתורים
- שיניי כותרות בתבנית
- שינויי כותרות בווקומרס
- שינויי סטרינגים
add_filter('gettext', 'translate_reply'); add_filter('ngettext', 'translate_reply'); function translate_reply($translated) { $translated = str_ireplace('Leave a Reply', 'Dejar un Comentario', $translated); return $translated; }
סקריפט משופר להוספת מספר סטרינגים
function my_text_strings( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'Buy product' : $translated_text = __( 'Buy product in Amazon', 'woocommerce' ); break; case 'החל מ- ' : $translated_text = __( 'From', 'woocommerce' ); break; } return $translated_text; } add_filter( 'gettext', 'my_text_strings', 20, 3 );
קישור למקור