Created
February 20, 2020 07:09
-
-
Save kkarpieszuk/0e7568ef56c6f825214cc6cf5da2b252 to your computer and use it in GitHub Desktop.
Replace WordPress word with link to the site in WordPress post content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add code below to functions.php file of your theme | |
add_filter( 'the_content', function( $content ) { | |
if ( ! is_admin() ) { | |
$content = str_replace( 'WordPress', '<a href="https://wordpress.org">WordPress</a>', $content ); | |
} | |
return $content; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment