Try to play with these:
function replace_text_wps($text){
$replace = array(
// 'WORD TO REPLACE' => 'REPLACE WORD WITH THIS'
'Frei' => '<a href="https://mysite.com/myafflink">Frei</a>',
'studiopress' => '<a href="https://mysite.com/myafflink">studiopress</a>'
);
$text = str_replace(array_keys($replace), $replace, $text);
return $text;
}
add_filter('the_content', 'replace_text_wps');
add_filter('the_excerpt', 'replace_text_wps');
add_filter('tablepress_table_output', 'replace_text_wps');
function replace_text($text) {
$text = str_replace('look-for-this-string', 'replace-with-this-string', $text);
$text = str_replace('look-for-that-string', 'replace-with-that-string', $text);
return $text;
}
add_filter('the_content', 'replace_text');
function replace_text_wps($text){
$replace = array(
// 'WORD TO REPLACE' => 'REPLACE WORD WITH THIS'
'wordpress' => '<a href="#">wordpress</a>',
'excerpt' => '<a href="#">excerpt</a>',
'function' => '<a href="#">function</a>'
);
$text = str_replace(array_keys($replace), $replace, $text);
return $text;
}
add_filter('the_content', 'replace_text_wps');
add_filter('the_excerpt', 'replace_text_wps');
function replace_content($content)
{
$content = str_replace('Company Name', '<span class="company">Company Name</span>',$content);
return $content;
}
add_filter('the_content','replace_content');
function replace_content($content)
{
$content = str_replace('##Replace Me##', '##With Something Else##',$content);
return $content;
}
add_filter('the_content','replace_content');
add_filter( 'gettext', 'wps_translate_words_array' );
add_filter( 'ngettext', 'wps_translate_words_array' );
function wps_translate_words_array( $translated ) {
$words = array(
// 'word to translate' = > 'translation'
'Posts' => 'Article',
'Post' => 'Articles',
'Pages' => 'Stuffing',
'Media' => 'Upload Images',
'Links' => 'Blog Roll',
);
$translated = str_ireplace( array_keys($words), $words, $translated );
return $translated;
}
add_filter('gettext', 'change_post_to_article');
add_filter('ngettext', 'change_post_to_article');
function change_post_to_article($translated) {
$translated = str_ireplace('Post', 'Article', $translated);
return $translated;